chrome: readd click to toggle nav drawer

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-10-01 18:34:37 -04:00
parent 9ff12cc11a
commit f59ec017c9
2 changed files with 7 additions and 12 deletions

View File

@@ -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);

View File

@@ -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
}
}