pub struct SettingsApp {Show 26 fields
selected_layout: KeyboardLayout,
selected_theme: String,
selected_fonts: [String; 3],
selected_sound: bool,
repeat_first_delay: u32,
repeat_first_interval: u32,
repeat_second_count: u32,
repeat_second_delay: u32,
repeat_second_interval: u32,
selected_caps_ctrl: bool,
last_win_w: u32,
last_win_h: u32,
active_tab_idx: usize,
selected_auto_dhcp: bool,
focused_item_idx: Option<usize>,
ssid_box: TextBox,
password_box: TextBox,
wifi_focused: u8,
wifi_status_msg: String,
wifi_connecting: bool,
status_msg: String,
status_is_error: bool,
custom_theme: ThemeConfig,
custom_edit_idx: usize,
enable_custom_colors: bool,
available_themes: Vec<String>,
}Fields§
§selected_layout: KeyboardLayout§selected_theme: String§selected_fonts: [String; 3]フォントのフォールバック順([0]=プライマリ)。設定アプリで3段セレクトする。
selected_sound: bool§repeat_first_delay: u32§repeat_first_interval: u32§repeat_second_count: u32§repeat_second_delay: u32§repeat_second_interval: u32§selected_caps_ctrl: bool§last_win_w: u32§last_win_h: u32§active_tab_idx: usize§selected_auto_dhcp: bool§focused_item_idx: Option<usize>§ssid_box: TextBox§password_box: TextBox§wifi_focused: u8§wifi_status_msg: String§wifi_connecting: bool§status_msg: String保存・適用の結果表示。失敗を黙って捨てず、必ずユーザーへ見せる。
status_is_error: boolstatus_msg が失敗の通知かどうか(表示色の切り替え用)。
custom_theme: ThemeConfig§custom_edit_idx: usize§enable_custom_colors: bool§available_themes: Vec<String>Implementations§
Source§impl SettingsApp
impl SettingsApp
pub fn new() -> Self
fn get_item_count(&self) -> usize
fn draw_focus_rect( &self, screen: &Screen, x: u32, y: u32, w: u32, h: u32, is_focused: bool, focus_color: Color, )
fn draw_text_field( &self, screen: &Screen, x: u32, y: u32, w: u32, tb: &TextBox, focused: bool, placeholder: &str, mask: bool, )
Sourcefn apply_and_save(&mut self)
fn apply_and_save(&mut self)
設定を適用・保存する。
失敗を握り潰さない: 以前は保存結果を捨てて常に完了音を鳴らし 「Config applied and saved!」と表示していたため、書き込めていなくても ユーザーには成功に見えていた。成功したときだけ成功を名乗る。
fn try_apply_and_save(&self) -> Result<(), &'static str>
fn get_color_rgb(c: u32) -> (u8, u8, u8)
fn make_color_u32(r: u8, g: u8, b: u8) -> u32
fn get_custom_color_by_idx(&self, idx: usize) -> u32
fn set_custom_color_by_idx(&mut self, idx: usize, color: u32)
fn adjust_channel(val: u8, dir: i32) -> u8
fn get_custom_color_name(idx: usize) -> &'static str
fn get_theme_preview_colors(name: &str) -> (u32, u32, u32)
fn start_wifi_connect(&mut self)
fn cycle_font(&mut self, slot: usize, dir: i32)
Sourcefn apply_theme_colorset(&mut self, theme_name: &str) -> Result<(), &'static str>
fn apply_theme_colorset(&mut self, theme_name: &str) -> Result<(), &'static str>
指定テーマのカラーセット /os/<name>.json を /os/colorset.json へ複製し、
設定を再読み込みする。読み出し・書き込み・再読み込みのどの失敗も
呼び出し側へ返す(従来は 3 段すべて let _ = で捨てていたため、
テーマを選んでも色が変わらない理由が分からなかった)。
Sourcefn select_theme(&mut self, theme_name: &str)
fn select_theme(&mut self, theme_name: &str)
テーマ選択(キーボード操作・マウス操作の共通処理)。
Sourcefn toggle_custom_colors(&mut self)
fn toggle_custom_colors(&mut self)
カスタムカラーの有効・無効を切り替える(キーボード・マウス共通処理)。
fn handle_action(&mut self, idx: usize)
Trait Implementations§
Source§impl App for SettingsApp
impl App for SettingsApp
fn name(&self) -> &str
fn active_tab(&self) -> usize
fn switch_tab(&mut self, idx: usize)
Source§fn draw(
&mut self,
screen: &Screen,
win_x: u32,
win_y: u32,
win_w: u32,
win_h: u32,
)
fn draw( &mut self, screen: &Screen, win_x: u32, win_y: u32, win_w: u32, win_h: u32, )
ウィンドウ内の描画要求
Source§fn on_mouse(
&mut self,
local_x: i32,
local_y: i32,
btn_left: bool,
_btn_right: bool,
_wheel: i32,
)
fn on_mouse( &mut self, local_x: i32, local_y: i32, btn_left: bool, _btn_right: bool, _wheel: i32, )
マウスイベント。ローカル座標とホイール移動量が渡される。
共有されるバックバッファを返す
Source§fn instance_info(&self) -> String
fn instance_info(&self) -> String
インスタンス特有の情報(ファイル名やURLなど)を返す
fn add_tab(&mut self)
Source§fn open_file_dialog(&mut self)
fn open_file_dialog(&mut self)
Alt+O: ファイルオープンダイアログを開く(未実装アプリはno-op)
Source§fn tab_thread_fn(&self) -> Option<fn()>
fn tab_thread_fn(&self) -> Option<fn()>
このアプリの各タブ用バックグラウンドスレッド関数を返す。
Some(fn) を返したアプリはタブ追加時にスケジューラでスレッドを起動する。
スレッド関数は引数なしの fn() で、グローバル Mutex 経由でアプリ状態と通信する。
fn get_dom_value(&self, _id: &str) -> Option<String>
fn set_dom_value(&mut self, _id: &str, _val: &str)
fn needs_timer_redraw(&self) -> bool
Source§fn get_buffer_updated_flag(&self) -> Option<Arc<AtomicBool>>
fn get_buffer_updated_flag(&self) -> Option<Arc<AtomicBool>>
ProxyApp の shared_buffer が更新されたことを通知する AtomicBool を返す。
ProxyApp でない通常のアプリは None を返す(デフォルト実装)。
Core 0 の dirty 判定がこのフラグを読んで矩形を登録する。
fn get_dom_content(&self, _id: &str) -> Option<String>
fn set_dom_content(&mut self, _id: &str, _val: &str)
Auto Trait Implementations§
impl Freeze for SettingsApp
impl RefUnwindSafe for SettingsApp
impl Send for SettingsApp
impl Sync for SettingsApp
impl Unpin for SettingsApp
impl UnsafeUnpin for SettingsApp
impl UnwindSafe for SettingsApp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more