pub struct SettingsApp {Show 28 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>,
snapshot_sched: SnapshotSchedule,
storage_info: Option<([String; 3], u64)>,
}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>§snapshot_sched: SnapshotSchedule§storage_info: Option<([String; 3], u64)>Storage タブの説明の行と、それを作った時刻(ms)。描画のたびに FS の錠を取ってスナップショットの表を 読まないよう、2 秒ごとか操作の後だけ作り直す(2026-11-12)。
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)
カスタムカラーの有効・無効を切り替える(キーボード・マウス共通処理)。
Sourcefn step_schedule(&mut self, field: u8, dir: i32)
fn step_schedule(&mut self, field: u8, dir: i32)
定期スナップショットの予定を 1 段変える(field: 0=曜日 1=時 2=分(5 分刻み)、dir: ±1。端で一周する)。
Sourcefn snapshot_now(&mut self)
fn snapshot_now(&mut self)
今すぐスナップショットを取って回収する(予定を待たずに整理したいとき)。
Sourcefn storage_info_cached(&mut self) -> [String; 3]
fn storage_info_cached(&mut self) -> [String; 3]
Storage タブの説明の行(2 秒以内に作ったものがあればそれ)。
Sourcefn storage_info_lines(&self) -> [String; 3]
fn storage_info_lines(&self) -> [String; 3]
Storage タブの説明の行(次の予定・スナップショットの件数・最新)。
fn handle_action(&mut self, idx: usize)
Trait Implementations§
Source§impl App for SettingsApp
impl App for SettingsApp
fn name(&self) -> &str
fn tabs(&self) -> Vec<String>
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など)を返す
Source§fn live_title(&self) -> Option<String>
fn live_title(&self) -> Option<String>
タブタイトル一覧。空を返すとタブなし扱い(非推奨: 全アプリは最低1タブ持つ)
タイトルバーに出す文字(
None なら作成時の Window.title)。ページで変わるアプリが使う。Source§fn memory_checkpoint(&mut self)
fn memory_checkpoint(&mut self)
アプリのスレッドの 1 周の頭(錠を持っていない所)で呼ばれる。メモリが足りないときに裏のタブを破棄する
アプリ(ブラウザ)が実装する(2026-11-19。判定は
kernel/tab_discard.rs)。fn add_tab(&mut self)
Source§fn open_url_in_new_tab(&mut self, _url: &str)
fn open_url_in_new_tab(&mut self, _url: &str)
同じアプリが URL つきで 2 度目に起動されたとき、その URL を新しいタブで開く(2026-11-18。ブラウザだけが実装する)。
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)
Source§fn is_stopped(&self) -> bool
fn is_stopped(&self) -> bool
アプリのスレッドがもう居ない(panic・メモリの使いすぎで止めた)か。ウィンドウは最後の画面のまま残る。
同じアプリを開き直すとき、
WindowManager::add_window はこのウィンドウを使い回さず置き換える。Source§fn unresponsive_ms(&self) -> Option<u64>
fn unresponsive_ms(&self) -> Option<u64>
アプリが応答していない時間(ms)。応答しているなら
None(TODO R2 (a))。
ProxyApp はアプリのスレッドの 1 周の始まりが UNRESPONSIVE_MS 以上前なら返す。
メインループで描くアプリは、ウォッチドッグの Not Responding(watchdog::is_not_responding)で見る(Window::unresponsive)。Source§fn kill_tab(&mut self, _idx: usize) -> bool
fn kill_tab(&mut self, _idx: usize) -> bool
タブを 1 つだけ止める(TODO R2 (d)、2026-11-18)。受け付けたら true。
ProxyApp は合図を立てるだけで、アプリのスレッドが、そのタブの JS を打ち切ってから 1 周の頭でタブを閉じる。Source§fn running_tab(&self) -> usize
fn running_tab(&self) -> usize
アプリのスレッドが今動かしているタブ(TODO R2 (d))。
ProxyApp では、利用者が応答しない間に
別のタブを選んでも(App::active_tab は選んだ先を返す)、アプリが実際に動かしているタブを返す。Source§fn tab_kill_pending(&self) -> Option<usize>
fn tab_kill_pending(&self) -> Option<usize>
タブを止める合図を立てたが、まだ閉じていないタブ(TODO R2 (d))。
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