T27: on Omarchy 4 an Omarchy theme wears the system's current theme, read from the ghostty.conf Omarchy renders, and follows each switch; it is the default where Omarchy runs, and its card leads the Appearance grid
This commit is contained in:
13 files changed
+233
-29
No files matched your search
+2
-5
@@ -82,7 +82,7 @@ impl Default for Settings {
|
||||
Self {
|
||||
shell: String::new(),
|
||||
start_in: StartIn::Home,
|
||||
theme: "catppuccin-mocha".into(),
|
||||
theme: themes::default_id().into(),
|
||||
dark_theme: None,
|
||||
font_family: "JetBrains Mono".into(),
|
||||
font_size: 13.0,
|
||||
@@ -124,10 +124,7 @@ impl Settings {
|
||||
("dark_theme", self.dark_theme.as_ref()),
|
||||
] {
|
||||
if let Some(id) = id {
|
||||
anyhow::ensure!(
|
||||
themes::find(id).is_some(),
|
||||
"{field} is {id:?}, no built-in theme"
|
||||
);
|
||||
anyhow::ensure!(themes::known(id), "{field} is {id:?}, no built-in theme");
|
||||
}
|
||||
}
|
||||
anyhow::ensure!(!self.font_family.is_empty(), "font_family is empty");
|
||||
|
||||
@@ -103,7 +103,7 @@ impl SettingsWindow {
|
||||
settings.cursor_style,
|
||||
|settings, style| settings.cursor_style = style,
|
||||
);
|
||||
let active = themes::active(settings, window.appearance());
|
||||
let active = themes::active(settings, window.appearance(), cx);
|
||||
let lit = self.lit || !settings.cursor_blink;
|
||||
let cursor = SettingsSection::new("Cursor")
|
||||
.row(SettingsRow::new("Style").control(style))
|
||||
@@ -113,7 +113,7 @@ impl SettingsWindow {
|
||||
settings.cursor_blink,
|
||||
|settings, on| settings.cursor_blink = on,
|
||||
)))
|
||||
.row(SettingsRow::new("Preview").control(prompt(settings, active, lit, cx)));
|
||||
.row(SettingsRow::new("Preview").control(prompt(settings, &active, lit, cx)));
|
||||
let opacity = percent(settings.background_opacity);
|
||||
let slider = Slider::new("background_opacity", opacity)
|
||||
.range(percent(*OPACITY.start()), percent(*OPACITY.end()))
|
||||
@@ -207,7 +207,7 @@ fn fraction(percent: f64) -> f32 {
|
||||
(percent / 100.) as f32
|
||||
}
|
||||
|
||||
/// Every built-in theme as a card over its preview; `dark` picks the one a dark system wears.
|
||||
/// Omarchy's theme where followed, then every built-in, as cards; `dark` picks the dark system's.
|
||||
fn grid(
|
||||
this: &Entity<SettingsWindow>,
|
||||
title: Option<&'static str>,
|
||||
@@ -222,7 +222,8 @@ fn grid(
|
||||
} else {
|
||||
("theme", Some(settings.theme.as_str()))
|
||||
};
|
||||
let cards = themes::all().iter().map(|each| {
|
||||
let omarchy = cx.try_global::<themes::Omarchy>().map(|omarchy| &omarchy.0);
|
||||
let cards = omarchy.into_iter().chain(themes::all()).map(|each| {
|
||||
let (id, this) = (each.id, this.clone());
|
||||
let key = SharedString::from(format!("{field}-{id}"));
|
||||
RadioCard::new(key, chosen == Some(id), each.name)
|
||||
|
||||
Reference in new issue
Block a user