Nacre/src/ui/pages/mod.rs
astar76 07b357deaf S015: Material You foundation: M3 schemes, Outfit, icons, springs, widgets, gallery
Fixes R1-01 (icon glyphs) and R1-02 (clock contrast).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-11 19:36:53 -06:00

83 lines
2.6 KiB
Rust

//! Nacre's own pages (nacre://...), drawn with egui inside the page area.
pub mod apps;
pub mod bookmarks;
pub mod devtools;
pub mod downloads;
pub mod gallery;
pub mod history;
pub mod misc;
pub mod newtab;
pub mod passwords;
pub mod settings;
use std::collections::HashSet;
use egui::Ui;
use super::Frame;
use crate::tabs::Page;
/// What the pages remember between frames (search boxes, forms being filled in).
#[derive(Default)]
pub struct PageState {
pub settings_section: String,
pub settings_search: String,
/// Action whose shortcut is being recorded.
pub capture_key: Option<crate::keys::Action>,
pub new_engine: (String, String),
pub new_list_url: String,
pub keep_active_input: String,
pub new_profile: String,
pub new_shortcut: (String, String),
pub master: (String, String),
pub history_search: String,
pub bookmarks_search: String,
pub bookmarks_folder: Option<u64>,
pub bookmark_edit: Option<(u64, String, String)>,
pub new_folder: String,
pub downloads_search: String,
pub passwords_tab: usize,
pub passwords_search: String,
pub revealed: HashSet<u64>,
pub login_edit: Option<crate::store::vault::Login>,
pub address_edit: Option<crate::store::vault::Address>,
pub card_edit: Option<crate::store::vault::Card>,
pub reauth: String,
pub reauth_error: String,
pub unlock: String,
pub unlock_error: String,
pub generated: String,
pub gen_passphrase: bool,
pub script_edit: Option<(u64, String)>,
pub new_script: String,
pub script_url: String,
pub site_search: String,
pub clear_range: usize,
pub clear_what: Vec<String>,
pub welcome_step: usize,
pub devtools_input: String,
pub devtools_tab: usize,
pub notes_dirty: bool,
}
pub fn draw(ui: &mut Ui, f: &mut Frame, page: &Page) {
match page {
Page::NewTab => newtab::draw(ui, f),
Page::Settings(section) => settings::draw(ui, f, section),
Page::History => history::draw(ui, f),
Page::Bookmarks => bookmarks::draw(ui, f),
Page::Downloads => downloads::draw(ui, f),
Page::Passwords => passwords::draw(ui, f),
Page::Apps => apps::draw(ui, f),
Page::SiteSettings(host) => misc::site_settings(ui, f, host),
Page::ClearData => misc::clear_data(ui, f),
Page::About => misc::about(ui, f),
Page::Welcome => misc::welcome(ui, f),
Page::TaskManager => misc::task_manager(ui, f),
Page::DevTools => devtools::draw(ui, f),
Page::Gallery => gallery::draw(ui),
Page::Source(url) => misc::source(ui, f, url),
Page::Error(url, why) => misc::error(ui, f, url, why),
}
}