Skip to main content

SettingsApp

Struct SettingsApp 

Source
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: bool

status_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

Source

pub fn new() -> Self

Source

fn get_item_count(&self) -> usize

Source

fn draw_focus_rect( &self, screen: &Screen, x: u32, y: u32, w: u32, h: u32, is_focused: bool, focus_color: Color, )

Source

fn draw_text_field( &self, screen: &Screen, x: u32, y: u32, w: u32, tb: &TextBox, focused: bool, placeholder: &str, mask: bool, )

Source

fn apply_and_save(&mut self)

設定を適用・保存する。

失敗を握り潰さない: 以前は保存結果を捨てて常に完了音を鳴らし 「Config applied and saved!」と表示していたため、書き込めていなくても ユーザーには成功に見えていた。成功したときだけ成功を名乗る。

Source

fn try_apply_and_save(&self) -> Result<(), &'static str>

Source

fn get_color_rgb(c: u32) -> (u8, u8, u8)

Source

fn make_color_u32(r: u8, g: u8, b: u8) -> u32

Source

fn get_custom_color_by_idx(&self, idx: usize) -> u32

Source

fn set_custom_color_by_idx(&mut self, idx: usize, color: u32)

Source

fn adjust_channel(val: u8, dir: i32) -> u8

Source

fn get_custom_color_name(idx: usize) -> &'static str

Source

fn get_theme_preview_colors(name: &str) -> (u32, u32, u32)

Source

fn start_wifi_connect(&mut self)

Source

fn cycle_font(&mut self, slot: usize, dir: i32)

Source

fn apply_theme_colorset(&mut self, theme_name: &str) -> Result<(), &'static str>

指定テーマのカラーセット /os/<name>.json を /os/colorset.json へ複製し、 設定を再読み込みする。読み出し・書き込み・再読み込みのどの失敗も 呼び出し側へ返す(従来は 3 段すべて let _ = で捨てていたため、 テーマを選んでも色が変わらない理由が分からなかった)。

Source

fn select_theme(&mut self, theme_name: &str)

テーマ選択(キーボード操作・マウス操作の共通処理)。

Source

fn toggle_custom_colors(&mut self)

カスタムカラーの有効・無効を切り替える(キーボード・マウス共通処理)。

Source

fn step_schedule(&mut self, field: u8, dir: i32)

定期スナップショットの予定を 1 段変える(field: 0=曜日 1=時 2=分(5 分刻み)、dir: ±1。端で一周する)。

Source

fn snapshot_now(&mut self)

今すぐスナップショットを取って回収する(予定を待たずに整理したいとき)。

Source

fn storage_info_cached(&mut self) -> [String; 3]

Storage タブの説明の行(2 秒以内に作ったものがあればそれ)。

Source

fn storage_info_lines(&self) -> [String; 3]

Storage タブの説明の行(次の予定・スナップショットの件数・最新)。

Source

fn handle_action(&mut self, idx: usize)

Trait Implementations§

Source§

impl App for SettingsApp

Source§

fn name(&self) -> &str

Source§

fn tabs(&self) -> Vec<String>

Source§

fn active_tab(&self) -> usize

Source§

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, )

ウィンドウ内の描画要求
Source§

fn on_mouse( &mut self, local_x: i32, local_y: i32, btn_left: bool, _btn_right: bool, _wheel: i32, )

マウスイベント。ローカル座標とホイール移動量が渡される。
Source§

fn on_key(&mut self, keycode: u8, pressed: bool, ascii: Option<char>)

キーボードイベント
Source§

fn is_proxy(&self) -> bool

ProxyApp であるかどうか
Source§

fn get_shared_buffer(&self) -> Option<Arc<Mutex<Vec<u32>>>>

共有されるバックバッファを返す
Source§

fn instance_info(&self) -> String

インスタンス特有の情報(ファイル名やURLなど)を返す
Source§

fn live_title(&self) -> Option<String>

タブタイトル一覧。空を返すとタブなし扱い(非推奨: 全アプリは最低1タブ持つ) タイトルバーに出す文字(None なら作成時の Window.title)。ページで変わるアプリが使う。
Source§

fn memory_checkpoint(&mut self)

アプリのスレッドの 1 周の頭(錠を持っていない所)で呼ばれる。メモリが足りないときに裏のタブを破棄する アプリ(ブラウザ)が実装する(2026-11-19。判定は kernel/tab_discard.rs)。
Source§

fn add_tab(&mut self)

Source§

fn open_url_in_new_tab(&mut self, _url: &str)

同じアプリが URL つきで 2 度目に起動されたとき、その URL を新しいタブで開く(2026-11-18。ブラウザだけが実装する)。
Source§

fn close_tab(&mut self, _idx: usize) -> bool

タブを閉じる。最後のタブが閉じられウィンドウも閉じる場合は true を返す。
Source§

fn open_file_dialog(&mut self)

Alt+O: ファイルオープンダイアログを開く(未実装アプリはno-op)
Source§

fn save_file(&mut self)

Alt+S: ファイルを保存する(未実装アプリはno-op)
Source§

fn tab_thread_fn(&self) -> Option<fn()>

このアプリの各タブ用バックグラウンドスレッド関数を返す。 Some(fn) を返したアプリはタブ追加時にスケジューラでスレッドを起動する。 スレッド関数は引数なしの fn() で、グローバル Mutex 経由でアプリ状態と通信する。
Source§

fn get_dom_value(&self, _id: &str) -> Option<String>

Source§

fn set_dom_value(&mut self, _id: &str, _val: &str)

Source§

fn needs_timer_redraw(&self) -> bool

Source§

fn get_buffer_updated_flag(&self) -> Option<Arc<AtomicBool>>

ProxyApp の shared_buffer が更新されたことを通知する AtomicBool を返す。 ProxyApp でない通常のアプリは None を返す(デフォルト実装)。 Core 0 の dirty 判定がこのフラグを読んで矩形を登録する。
Source§

fn get_dom_content(&self, _id: &str) -> Option<String>

Source§

fn set_dom_content(&mut self, _id: &str, _val: &str)

Source§

fn on_resize(&mut self, _width: u32, _height: u32)

ウィンドウサイズ変更の通知
Source§

fn is_stopped(&self) -> bool

アプリのスレッドがもう居ない(panic・メモリの使いすぎで止めた)か。ウィンドウは最後の画面のまま残る。 同じアプリを開き直すとき、WindowManager::add_window はこのウィンドウを使い回さず置き換える。
Source§

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

タブを 1 つだけ止める(TODO R2 (d)、2026-11-18)。受け付けたら true。 ProxyApp は合図を立てるだけで、アプリのスレッドが、そのタブの JS を打ち切ってから 1 周の頭でタブを閉じる。
Source§

fn running_tab(&self) -> usize

アプリのスレッドが今動かしているタブ(TODO R2 (d))。ProxyApp では、利用者が応答しない間に 別のタブを選んでも(App::active_tab は選んだ先を返す)、アプリが実際に動かしているタブを返す。
Source§

fn tab_kill_pending(&self) -> Option<usize>

タブを止める合図を立てたが、まだ閉じていないタブ(TODO R2 (d))。
Source§

fn os_tick(&mut self)

メインループが毎周 1 回呼ぶ(TODO R4 (b)、2026-11-17)。ProxyApp はここで、錠が取れずに控えた入力・ タブの切り替えをアプリへ渡し直し、題名・タブの写しを取り直す。錠は待たない(try_lock)。
Source§

impl Default for SettingsApp

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.