mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-19 01:24:21 +01:00
@@ -26,6 +26,7 @@ pub mod profile;
|
|||||||
pub mod relay_debug;
|
pub mod relay_debug;
|
||||||
pub mod relayspec;
|
pub mod relayspec;
|
||||||
mod result;
|
mod result;
|
||||||
|
mod route;
|
||||||
mod setup;
|
mod setup;
|
||||||
pub mod storage;
|
pub mod storage;
|
||||||
mod style;
|
mod style;
|
||||||
@@ -78,6 +79,7 @@ pub use profile::get_profile_url;
|
|||||||
pub use relay_debug::RelayDebugView;
|
pub use relay_debug::RelayDebugView;
|
||||||
pub use relayspec::RelaySpec;
|
pub use relayspec::RelaySpec;
|
||||||
pub use result::Result;
|
pub use result::Result;
|
||||||
|
pub use route::DrawerRouter;
|
||||||
pub use storage::{AccountStorage, DataPath, DataPathType, Directory};
|
pub use storage::{AccountStorage, DataPath, DataPathType, Directory};
|
||||||
pub use style::NotedeckTextStyle;
|
pub use style::NotedeckTextStyle;
|
||||||
pub use theme::ColorTheme;
|
pub use theme::ColorTheme;
|
||||||
|
|||||||
31
crates/notedeck/src/route.rs
Normal file
31
crates/notedeck/src/route.rs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
#[derive(Clone, Debug, Default)]
|
||||||
|
pub struct DrawerRouter {
|
||||||
|
pub returning: bool,
|
||||||
|
pub navigating: bool,
|
||||||
|
pub drawer_focused: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl DrawerRouter {
|
||||||
|
pub fn open(&mut self) {
|
||||||
|
self.navigating = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn close(&mut self) {
|
||||||
|
self.returning = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn closed(&mut self) {
|
||||||
|
self.clear();
|
||||||
|
self.drawer_focused = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn clear(&mut self) {
|
||||||
|
self.navigating = false;
|
||||||
|
self.returning = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn opened(&mut self) {
|
||||||
|
self.clear();
|
||||||
|
self.drawer_focused = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user