diff --git a/crates/notedeck_chrome/src/chrome.rs b/crates/notedeck_chrome/src/chrome.rs index e81f740..60b43f1 100644 --- a/crates/notedeck_chrome/src/chrome.rs +++ b/crates/notedeck_chrome/src/chrome.rs @@ -165,7 +165,11 @@ impl Chrome { } pub fn toggle(&mut self) { - self.options.toggle(ChromeOptions::IsOpen); + if self.nav.drawer_focused { + self.nav.close(); + } else { + self.nav.open(); + } } pub fn add_app(&mut self, app: NotedeckApp) { @@ -327,8 +331,7 @@ impl Chrome { } if ui.add(expand_side_panel_button()).clicked() { - //self.active = (self.active + 1) % (self.apps.len() as i32); - self.options.toggle(ChromeOptions::IsOpen); + self.nav.close(); } ui.add_space(4.0); diff --git a/crates/notedeck_chrome/src/options.rs b/crates/notedeck_chrome/src/options.rs index 8fd9d67..3f28105 100644 --- a/crates/notedeck_chrome/src/options.rs +++ b/crates/notedeck_chrome/src/options.rs @@ -7,9 +7,6 @@ bitflags! { /// Is the chrome currently open? const NoOptions = 0; - /// Is the chrome currently open? - const IsOpen = 1 << 0; - /// Are we simulating a virtual keyboard? This is mostly for debugging /// if we are too lazy to open up a real mobile device with soft /// keyboard @@ -28,11 +25,6 @@ bitflags! { impl Default for ChromeOptions { fn default() -> Self { - let mut options = ChromeOptions::NoOptions; - options.set( - ChromeOptions::IsOpen, - !notedeck::ui::is_compiled_as_mobile(), - ); - options + ChromeOptions::NoOptions } }