refactor: extract FormNav trait, unify form key handling, decentralize view titles and hints
This commit is contained in:
+8
-1
@@ -1,4 +1,4 @@
|
||||
use super::TextEditing;
|
||||
use super::{FormNav, TextEditing};
|
||||
use crate::config::SyncBackend;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
@@ -128,6 +128,13 @@ impl SettingsState {
|
||||
}
|
||||
}
|
||||
|
||||
impl FormNav for SettingsState {
|
||||
fn nav_next(&mut self) { self.next_field(); }
|
||||
fn nav_prev(&mut self) { self.prev_field(); }
|
||||
fn active_is_toggle(&self) -> bool { self.active.is_toggle() }
|
||||
fn active_is_text(&self) -> bool { self.active.is_text() }
|
||||
}
|
||||
|
||||
impl Default for SettingsState {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
|
||||
Reference in New Issue
Block a user