Add private window entry point

This commit is contained in:
2026-05-09 00:31:40 -04:00
parent 97a06d7b52
commit 7797203bbf
6 changed files with 139 additions and 29 deletions
+21 -2
View File
@@ -43,7 +43,10 @@ pub use spaces::TrashedSpace;
pub struct InitialBrowserConfig {
pub space_name: String,
pub space_icon: String,
pub space_color_hex: u32,
pub profile_name: String,
pub profile_color_hex: u32,
pub profile_kind: ProfileKind,
pub new_tab_destination: NewTabDestination,
}
@@ -52,7 +55,22 @@ impl InitialBrowserConfig {
Ok(Self {
space_name: "Work".to_string(),
space_icon: "W".to_string(),
space_color_hex: 0xf54e00,
profile_name: "Default".to_string(),
profile_color_hex: 0x26251e,
profile_kind: ProfileKind::Standard,
new_tab_destination: NewTabDestination::default(),
})
}
pub fn private_window() -> Result<Self, DomainError> {
Ok(Self {
space_name: "Private".to_string(),
space_icon: "P".to_string(),
space_color_hex: 0x807d72,
profile_name: "Private".to_string(),
profile_color_hex: 0x807d72,
profile_kind: ProfileKind::Private,
new_tab_destination: NewTabDestination::default(),
})
}
@@ -127,12 +145,13 @@ pub struct BrowserCore {
impl BrowserCore {
pub fn new(config: InitialBrowserConfig) -> Result<Self, CoreError> {
let profile = Profile::new(config.profile_name, 0x26251e, ProfileKind::Standard);
let profile =
Profile::new(config.profile_name, config.profile_color_hex, config.profile_kind);
let active_profile_id = profile.id().clone();
let space = Space::new(
config.space_name,
config.space_icon,
0xf54e00,
config.space_color_hex,
active_profile_id.clone(),
0,
);