mirror of
https://github.com/aljazceru/notedeck.git
synced 2026-02-02 23:24:19 +01:00
chrome: readd click to toggle nav drawer
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user