refactor(gui): extract AppContext for shared page handles

KeysPage::new now takes a single AppContext that owns parent_window,
toast_overlay, and the shared daemon Rc<RefCell<Option<Daemon>>>. Phases
9, 10, 11, and 12 GUI tab will all consume this struct.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
michael
2026-04-27 10:42:11 -07:00
parent d20643cde5
commit a927d96630
3 changed files with 40 additions and 15 deletions

View File

@@ -1,6 +1,7 @@
use adw::prelude::*;
use gtk::glib;
mod app_context;
mod bus;
mod enroll_dialog;
mod error;
@@ -36,7 +37,8 @@ fn main() -> glib::ExitCode {
header.set_title_widget(Some(&switcher));
let toast_overlay = adw::ToastOverlay::new();
let keys = keys_page::KeysPage::new(win.clone().upcast(), toast_overlay.clone());
let ctx = app_context::AppContext::new(win.clone().upcast(), toast_overlay.clone());
let keys = keys_page::KeysPage::new(ctx.clone());
stack.add_titled(&keys.root, Some("keys"), "Keys");
// ToolbarView is libadwaita v1_4-gated; the project sticks with the