tweak: redefine window and view colors
This commit is contained in:
parent
2a2e455151
commit
6fb45b99f5
1 changed files with 21 additions and 26 deletions
|
|
@ -39,26 +39,24 @@ impl Theme {
|
||||||
intensity_effect: IntensityEffect::Shade,
|
intensity_effect: IntensityEffect::Shade,
|
||||||
};
|
};
|
||||||
|
|
||||||
// window elements that are not buttons or views
|
// the background container
|
||||||
let window_colors = {
|
let view_colors = IniColors {
|
||||||
let window = &self.background.component;
|
background_alternate: self.background.base.mix(self.accent.base, 0.05),
|
||||||
IniColors {
|
background_normal: self.background.base,
|
||||||
background_alternate: window.base.mix(self.accent.base, 0.1),
|
|
||||||
background_normal: window.base,
|
|
||||||
foreground_active: self.accent_text_color(),
|
foreground_active: self.accent_text_color(),
|
||||||
foreground_inactive: self.background.component.on.mix(window.base, 0.1),
|
foreground_inactive: self.background.on.mix(self.background.base, 0.1),
|
||||||
foreground_link: self.link_button.base,
|
foreground_link: self.link_button.base,
|
||||||
foreground_negative: self.destructive_text_color(),
|
foreground_negative: self.destructive_text_color(),
|
||||||
foreground_neutral: self.warning_text_color(),
|
foreground_neutral: self.warning_text_color(),
|
||||||
foreground_normal: self.background.component.on,
|
foreground_normal: self.background.on,
|
||||||
foreground_positive: self.success_text_color(),
|
foreground_positive: self.success_text_color(),
|
||||||
foreground_visited: self.accent_text_color(),
|
foreground_visited: self.accent_text_color(),
|
||||||
}
|
|
||||||
};
|
};
|
||||||
let view_colors = IniColors {
|
// components inside the background container
|
||||||
background_alternate: self.background.base.mix(self.accent.base, 0.1),
|
let window_colors = IniColors {
|
||||||
background_normal: self.background.base,
|
background_alternate: self.background.component.base.mix(self.accent.base, 0.05),
|
||||||
..window_colors
|
background_normal: self.background.component.base,
|
||||||
|
..view_colors
|
||||||
};
|
};
|
||||||
|
|
||||||
// selected text and items
|
// selected text and items
|
||||||
|
|
@ -83,7 +81,7 @@ impl Theme {
|
||||||
let button_colors = IniColors {
|
let button_colors = IniColors {
|
||||||
background_alternate: self.accent_button.base,
|
background_alternate: self.accent_button.base,
|
||||||
background_normal: self.button.base,
|
background_normal: self.button.base,
|
||||||
..window_colors
|
..view_colors
|
||||||
};
|
};
|
||||||
|
|
||||||
// Complementary: Areas of applications with an alternative color scheme; usually with a dark background for light color schemes.
|
// Complementary: Areas of applications with an alternative color scheme; usually with a dark background for light color schemes.
|
||||||
|
|
@ -107,14 +105,11 @@ impl Theme {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let header_colors = IniColors {
|
// headers in cosmic don't have a background
|
||||||
background_alternate: window_colors.background_normal,
|
let header_colors = &view_colors;
|
||||||
background_normal: window_colors.background_alternate,
|
let header_colors_inactive = &view_colors;
|
||||||
..window_colors
|
|
||||||
};
|
|
||||||
let header_colors_inactive = &window_colors;
|
|
||||||
// tool tips, "What's This" tips, and similar elements
|
// tool tips, "What's This" tips, and similar elements
|
||||||
let tooltip_colors = &header_colors;
|
let tooltip_colors = &window_colors;
|
||||||
|
|
||||||
let light_or_dark = if self.is_dark { "Dark" } else { "Light" };
|
let light_or_dark = if self.is_dark { "Dark" } else { "Light" };
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue