refactor: extract FormNav trait, unify form key handling, decentralize view titles and hints

This commit is contained in:
2026-05-27 02:09:44 +08:00
parent d3bd4af634
commit 0d65be65d3
16 changed files with 238 additions and 316 deletions
+8 -1
View File
@@ -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 {