commit f59ec017c9e40c49640a2e06eda2fde3be2159dd
parent 9ff12cc11abca0e570414e0f7624ff4b0d3ea1be
Author: kernelkind <kernelkind@gmail.com>
Date: Wed, 1 Oct 2025 18:34:37 -0400
chrome: readd click to toggle nav drawer
Signed-off-by: kernelkind <kernelkind@gmail.com>
Diffstat:
2 files changed, 7 insertions(+), 12 deletions(-)
diff --git 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
@@ -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
}
}