Preserve live dimming settings and stabilize theme transition borders
This commit is contained in:
1 parent
dec4d54bd4
commit
9e966f81a0
9 files changed
+102
-30
No files matched your search
@@ -300,7 +300,7 @@ pub(super) fn workspace_selector_style(
|
||||
background: if active {
|
||||
Some(Background::Color(color_with_opacity(shell_theme.accent, 0.16)))
|
||||
} else if occupied {
|
||||
Some(Background::Color(color_with_opacity(shell_theme.text_primary, 0.04)))
|
||||
Some(Background::Color(color_with_opacity(shell_theme.border, 0.3)))
|
||||
} else {
|
||||
None
|
||||
},
|
||||
@@ -326,9 +326,9 @@ pub(super) fn bar_style(theme: ShellTheme, compositor_material: bool) -> contain
|
||||
|
||||
pub(super) fn bar_group_style(theme: ShellTheme) -> container::Style {
|
||||
container::Style {
|
||||
background: Some(Background::Color(color_with_opacity(theme.text_primary, 0.035))),
|
||||
background: Some(Background::Color(color_with_opacity(theme.border, 0.25))),
|
||||
border: Border {
|
||||
color: color_with_opacity(theme.text_muted, 0.12),
|
||||
color: color(theme.border),
|
||||
width: 1.0,
|
||||
radius: theme.material_radius.min(16.0).into(),
|
||||
},
|
||||
|
||||
@@ -1069,6 +1069,25 @@ mod tests {
|
||||
assert_eq!(configured_font(None), cosmic::font::default());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bar_decoration_does_not_follow_transitional_text_contrast() {
|
||||
let theme = config::ShellTheme::default();
|
||||
let contrasted = config::ShellTheme {
|
||||
text_primary: [0, 0, 0, 255],
|
||||
text_muted: [255, 255, 255, 255],
|
||||
..theme
|
||||
};
|
||||
let before = bar_group_style(theme);
|
||||
let after = bar_group_style(contrasted);
|
||||
assert_eq!(before.border, after.border);
|
||||
assert_eq!(before.background, after.background);
|
||||
assert_eq!(before.border.color, color(theme.border));
|
||||
assert_eq!(
|
||||
workspace_selector_style(false, false, true, theme).background,
|
||||
workspace_selector_style(false, false, true, contrasted).background,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn workspace_selector_has_distinct_active_paint() {
|
||||
let theme = ShellTheme::default();
|
||||
|
||||
@@ -218,7 +218,7 @@ impl FereseShell {
|
||||
text_color: Some(primary),
|
||||
icon_color: Some(primary),
|
||||
border: Border {
|
||||
color: color_with_opacity(theme.text_muted, 0.18 * p),
|
||||
color: color_with_opacity(theme.border, p),
|
||||
width: 1.0,
|
||||
radius: theme.material_radius.into(),
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user