mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-06 10:03:26 -08:00
[Icons] Keep semantic red and green on themed glyphs
The one-glyph cutover recolored every icon from a single palette role, so a disabled deck, a not-ready player and a remove button all lost the red or green that carried their meaning. Add Positive and Negative application colors beside the accents, ship scheme-appropriate defaults for every theme, and resolve them through ThemeManager. Icons now take an IconTint: a palette role for structural glyphs, or a semantic role for states and add/remove actions. A disabled semantic icon falls back to the disabled foreground; on a selected row a semantic tint keeps its color only while it stays legible on the highlight, and a palette tint keeps the existing WindowText -> HighlightedText swap.
This commit is contained in:
parent
df74917cb0
commit
db4e07e55d
35 changed files with 339 additions and 53 deletions
|
|
@ -20,6 +20,8 @@ enum Role
|
|||
{
|
||||
AccentStrong,
|
||||
AccentSoft,
|
||||
Positive,
|
||||
Negative,
|
||||
};
|
||||
Q_ENUM_NS(Role)
|
||||
} // namespace AppColor
|
||||
|
|
@ -41,6 +43,16 @@ enum Role
|
|||
Q_ENUM_NS(Role)
|
||||
} // namespace AppFont
|
||||
|
||||
/**
|
||||
* @brief Fallback for an application color role when the active theme does not
|
||||
* define one.
|
||||
*
|
||||
* Accent roles return an invalid QColor because ThemeManager derives them from
|
||||
* the palette highlight. Semantic roles return an opaque, scheme-appropriate
|
||||
* default so a theme written before the role existed still renders it sensibly.
|
||||
*/
|
||||
QColor defaultAppColor(AppColor::Role role, bool dark);
|
||||
|
||||
struct ThemeConfig
|
||||
{
|
||||
QString colorScheme;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue