components: Move LoadingState into utils
This commit is contained in:
parent
5e03a39f41
commit
1c4d275394
|
@ -3,21 +3,6 @@ use gtk::{glib, glib::clone, prelude::*, subclass::prelude::*, CompositeTemplate
|
|||
|
||||
use super::Spinner;
|
||||
|
||||
/// The state of a resource that can be loaded.
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, glib::Enum)]
|
||||
#[enum_type(name = "LoadingState")]
|
||||
pub enum LoadingState {
|
||||
/// It hasn't been loaded yet.
|
||||
#[default]
|
||||
Initial,
|
||||
/// It is currently loading.
|
||||
Loading,
|
||||
/// It has been fully loaded.
|
||||
Ready,
|
||||
/// An error occurred while loading it.
|
||||
Error,
|
||||
}
|
||||
|
||||
mod imp {
|
||||
use std::cell::Cell;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ pub use self::{
|
|||
editable_avatar::EditableAvatar,
|
||||
image_paintable::ImagePaintable,
|
||||
label_with_widgets::{LabelWithWidgets, DEFAULT_PLACEHOLDER},
|
||||
loading_row::{LoadingRow, LoadingState},
|
||||
loading_row::LoadingRow,
|
||||
location_viewer::LocationViewer,
|
||||
media_content_viewer::{ContentType, MediaContentViewer},
|
||||
overlapping_avatars::OverlappingAvatars,
|
||||
|
|
|
@ -15,7 +15,7 @@ use matrix_sdk::{
|
|||
use tracing::error;
|
||||
|
||||
use super::{Event, Member, Membership, Room};
|
||||
use crate::{components::LoadingState, spawn, spawn_tokio};
|
||||
use crate::{spawn, spawn_tokio, utils::LoadingState};
|
||||
|
||||
mod imp {
|
||||
use std::cell::{Cell, RefCell};
|
||||
|
|
|
@ -3,9 +3,9 @@ use gtk::{gio, glib, glib::clone, prelude::*, subclass::prelude::*};
|
|||
|
||||
use super::MembershipSubpageItem;
|
||||
use crate::{
|
||||
components::{LoadingRow, LoadingState},
|
||||
components::LoadingRow,
|
||||
session::model::MemberList,
|
||||
utils::BoundObjectWeakRef,
|
||||
utils::{BoundObjectWeakRef, LoadingState},
|
||||
};
|
||||
|
||||
mod imp {
|
||||
|
|
|
@ -392,3 +392,18 @@ impl<T> Drop for TokioDrop<T> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The state of a resource that can be loaded.
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, glib::Enum)]
|
||||
#[enum_type(name = "LoadingState")]
|
||||
pub enum LoadingState {
|
||||
/// It hasn't been loaded yet.
|
||||
#[default]
|
||||
Initial,
|
||||
/// It is currently loading.
|
||||
Loading,
|
||||
/// It has been fully loaded.
|
||||
Ready,
|
||||
/// An error occurred while loading it.
|
||||
Error,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue