mirror of
https://github.com/jwinterm/grim.git
synced 2026-11-18 03:33:53 +01:00
ui: input refactoring
This commit is contained in:
@@ -46,6 +46,8 @@ pub struct AppConfig {
|
||||
|
||||
/// Locale code for i18n.
|
||||
lang: Option<String>,
|
||||
/// Flag to use English locale layout on keyboard.
|
||||
english_keyboard: Option<bool>,
|
||||
|
||||
/// Flag to check if dark theme should be used, use system settings if not set.
|
||||
use_dark_theme: Option<bool>,
|
||||
@@ -64,6 +66,7 @@ impl Default for AppConfig {
|
||||
x: None,
|
||||
y: None,
|
||||
lang: None,
|
||||
english_keyboard: None,
|
||||
use_dark_theme: None,
|
||||
}
|
||||
}
|
||||
@@ -212,6 +215,20 @@ impl AppConfig {
|
||||
None
|
||||
}
|
||||
|
||||
/// Toggle English locale layout. for software keyboard.
|
||||
pub fn toggle_english_keyboard() {
|
||||
let english = Self::english_keyboard();
|
||||
let mut w_app_config = Settings::app_config_to_update();
|
||||
w_app_config.english_keyboard = Some(!english);
|
||||
w_app_config.save();
|
||||
}
|
||||
|
||||
/// Check if English locale layout should be used for software keyboard.
|
||||
pub fn english_keyboard() -> bool {
|
||||
let r_config = Settings::app_config_to_read();
|
||||
r_config.english_keyboard.unwrap_or(false)
|
||||
}
|
||||
|
||||
/// Check if integrated node warning is needed for Android.
|
||||
pub fn android_integrated_node_warning_needed() -> bool {
|
||||
let r_config = Settings::app_config_to_read();
|
||||
|
||||
Reference in New Issue
Block a user