fix(configuration): leave notification up when base mode changes (#3696)
This commit is contained in:
parent
c28dbe8c28
commit
a71b18327a
3 changed files with 22 additions and 2 deletions
|
|
@ -32,8 +32,16 @@ impl Screen {
|
||||||
Screen::new_reset_keybindings_screen(Some(0));
|
Screen::new_reset_keybindings_screen(Some(0));
|
||||||
} else {
|
} else {
|
||||||
match self {
|
match self {
|
||||||
Screen::RebindLeaders(r) => *r = Default::default(),
|
Screen::RebindLeaders(r) => {
|
||||||
Screen::Presets(r) => *r = Default::default(),
|
let notification = r.drain_notification();
|
||||||
|
*r = Default::default();
|
||||||
|
r.set_notification(notification);
|
||||||
|
},
|
||||||
|
Screen::Presets(r) => {
|
||||||
|
let notification = r.drain_notification();
|
||||||
|
*r = Default::default();
|
||||||
|
r.set_notification(notification);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -190,6 +190,12 @@ impl PresetsScreen {
|
||||||
pub fn reset_selected_index(&mut self) {
|
pub fn reset_selected_index(&mut self) {
|
||||||
self.selected_index = Some(0);
|
self.selected_index = Some(0);
|
||||||
}
|
}
|
||||||
|
pub fn drain_notification(&mut self) -> Option<String> {
|
||||||
|
self.notification.take()
|
||||||
|
}
|
||||||
|
pub fn set_notification(&mut self, notification: Option<String>) {
|
||||||
|
self.notification = notification;
|
||||||
|
}
|
||||||
fn reconfigure(&self, selected: usize, write_to_disk: bool) {
|
fn reconfigure(&self, selected: usize, write_to_disk: bool) {
|
||||||
if selected == 0 {
|
if selected == 0 {
|
||||||
// TODO: these should be part of a "transaction" when they are
|
// TODO: these should be part of a "transaction" when they are
|
||||||
|
|
|
||||||
|
|
@ -680,6 +680,12 @@ impl RebindLeadersScreen {
|
||||||
self.handle_default_preset_key(key)
|
self.handle_default_preset_key(key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
pub fn drain_notification(&mut self) -> Option<String> {
|
||||||
|
self.notification.take()
|
||||||
|
}
|
||||||
|
pub fn set_notification(&mut self, notification: Option<String>) {
|
||||||
|
self.notification = notification;
|
||||||
|
}
|
||||||
fn currently_in_unlock_first(&self) -> bool {
|
fn currently_in_unlock_first(&self) -> bool {
|
||||||
if self.is_rebinding_for_presets {
|
if self.is_rebinding_for_presets {
|
||||||
false
|
false
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue