mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:07:35 +00:00
LibDraw: Add MenuBaseText and MenuSelectionText color roles
This allows the very aesthetic "Hotdog Stand" theme to have quite reasonable looking menus.
This commit is contained in:
parent
5330593e38
commit
5be6a43860
8 changed files with 17 additions and 42 deletions
|
@ -1,38 +1,31 @@
|
||||||
[Colors]
|
[Colors]
|
||||||
DesktopBackground=#202020
|
DesktopBackground=#202020
|
||||||
|
|
||||||
ActiveWindowBorder1=#3d3d4f
|
ActiveWindowBorder1=#3d3d4f
|
||||||
ActiveWindowBorder2=#b7b7da
|
ActiveWindowBorder2=#b7b7da
|
||||||
ActiveWindowTitle=white
|
ActiveWindowTitle=white
|
||||||
|
|
||||||
InactiveWindowBorder1=#606060
|
InactiveWindowBorder1=#606060
|
||||||
InactiveWindowBorder2=#a0a0a0
|
InactiveWindowBorder2=#a0a0a0
|
||||||
InactiveWindowTitle=#d5d0c7
|
InactiveWindowTitle=#d5d0c7
|
||||||
|
|
||||||
MovingWindowBorder1=#49496c
|
MovingWindowBorder1=#49496c
|
||||||
MovingWindowBorder2=#9c9cd5
|
MovingWindowBorder2=#9c9cd5
|
||||||
MovingWindowTitle=white
|
MovingWindowTitle=white
|
||||||
|
|
||||||
HighlightWindowBorder1=#a10d0d
|
HighlightWindowBorder1=#a10d0d
|
||||||
HighlightWindowBorder2=#fabbbb
|
HighlightWindowBorder2=#fabbbb
|
||||||
HighlightWindowTitle=white
|
HighlightWindowTitle=white
|
||||||
|
|
||||||
MenuBase=#444444
|
MenuBase=#444444
|
||||||
|
MenuBaseText=white
|
||||||
MenuStripe=#323232
|
MenuStripe=#323232
|
||||||
MenuSelection=#666666
|
MenuSelection=#666666
|
||||||
|
MenuSelectionText=white
|
||||||
Window=#323232
|
Window=#323232
|
||||||
WindowText=white
|
WindowText=white
|
||||||
Button=#555555
|
Button=#555555
|
||||||
ButtonText=white
|
ButtonText=white
|
||||||
Base=#424242
|
Base=#424242
|
||||||
BaseText=white
|
BaseText=white
|
||||||
|
|
||||||
ThreedHighlight=#6f6f6f
|
ThreedHighlight=#6f6f6f
|
||||||
ThreedShadow1=#3d3e40
|
ThreedShadow1=#3d3e40
|
||||||
ThreedShadow2=#2e2f30
|
ThreedShadow2=#2e2f30
|
||||||
|
|
||||||
HoverHighlight=#696969
|
HoverHighlight=#696969
|
||||||
|
|
||||||
Selection=#14141a
|
Selection=#14141a
|
||||||
SelectionText=white
|
SelectionText=white
|
||||||
|
|
|
@ -1,39 +1,31 @@
|
||||||
[Colors]
|
[Colors]
|
||||||
DesktopBackground=#404040
|
DesktopBackground=#404040
|
||||||
|
|
||||||
ActiveWindowBorder1=#6e2209
|
ActiveWindowBorder1=#6e2209
|
||||||
ActiveWindowBorder2=#f4ca9e
|
ActiveWindowBorder2=#f4ca9e
|
||||||
ActiveWindowTitle=white
|
ActiveWindowTitle=white
|
||||||
|
|
||||||
InactiveWindowBorder1=#808080
|
InactiveWindowBorder1=#808080
|
||||||
InactiveWindowBorder2=#c0c0c0
|
InactiveWindowBorder2=#c0c0c0
|
||||||
InactiveWindowTitle=#d5d0c7
|
InactiveWindowTitle=#d5d0c7
|
||||||
|
|
||||||
MovingWindowBorder1=#a1320d
|
MovingWindowBorder1=#a1320d
|
||||||
MovingWindowBorder2=#fadcbb
|
MovingWindowBorder2=#fadcbb
|
||||||
MovingWindowTitle=white
|
MovingWindowTitle=white
|
||||||
|
|
||||||
HighlightWindowBorder1=#a10d0d
|
HighlightWindowBorder1=#a10d0d
|
||||||
HighlightWindowBorder2=#fabbbb
|
HighlightWindowBorder2=#fabbbb
|
||||||
HighlightWindowTitle=white
|
HighlightWindowTitle=white
|
||||||
|
|
||||||
MenuBase=white
|
MenuBase=white
|
||||||
|
MenuBaseText=black
|
||||||
MenuStripe=#bbb7b0
|
MenuStripe=#bbb7b0
|
||||||
MenuSelection=#ad714f
|
MenuSelection=#ad714f
|
||||||
|
MenuSelectionText=white
|
||||||
Window=#d4d0c8
|
Window=#d4d0c8
|
||||||
WindowText=black
|
WindowText=black
|
||||||
Button=#d4d0c8
|
Button=#d4d0c8
|
||||||
ButtonText=black
|
ButtonText=black
|
||||||
|
|
||||||
Base=white
|
Base=white
|
||||||
BaseText=black
|
BaseText=black
|
||||||
|
|
||||||
ThreedHighlight=white
|
ThreedHighlight=white
|
||||||
ThreedShadow1=#808080
|
ThreedShadow1=#808080
|
||||||
ThreedShadow2=#404040
|
ThreedShadow2=#404040
|
||||||
|
|
||||||
HoverHighlight=#e3dfdb
|
HoverHighlight=#e3dfdb
|
||||||
|
|
||||||
Selection=#84351a
|
Selection=#84351a
|
||||||
SelectionText=white
|
SelectionText=white
|
||||||
|
|
|
@ -1,39 +1,31 @@
|
||||||
[Colors]
|
[Colors]
|
||||||
DesktopBackground=yellow
|
DesktopBackground=yellow
|
||||||
|
|
||||||
ActiveWindowBorder1=black
|
ActiveWindowBorder1=black
|
||||||
ActiveWindowBorder2=black
|
ActiveWindowBorder2=black
|
||||||
ActiveWindowTitle=white
|
ActiveWindowTitle=white
|
||||||
|
|
||||||
InactiveWindowBorder1=red
|
InactiveWindowBorder1=red
|
||||||
InactiveWindowBorder2=red
|
InactiveWindowBorder2=red
|
||||||
InactiveWindowTitle=white
|
InactiveWindowTitle=white
|
||||||
|
|
||||||
MovingWindowBorder1=black
|
MovingWindowBorder1=black
|
||||||
MovingWindowBorder2=black
|
MovingWindowBorder2=black
|
||||||
MovingWindowTitle=white
|
MovingWindowTitle=white
|
||||||
|
|
||||||
HighlightWindowBorder1=black
|
HighlightWindowBorder1=black
|
||||||
HighlightWindowBorder2=black
|
HighlightWindowBorder2=black
|
||||||
HighlightWindowTitle=white
|
HighlightWindowTitle=white
|
||||||
|
|
||||||
MenuBase=white
|
MenuBase=white
|
||||||
|
MenuBaseText=black
|
||||||
MenuStripe=red
|
MenuStripe=red
|
||||||
MenuSelection=#550000
|
MenuSelection=#550000
|
||||||
|
MenuSelectionText=white
|
||||||
Window=red
|
Window=red
|
||||||
WindowText=white
|
WindowText=white
|
||||||
Button=#c0c0c0
|
Button=#c0c0c0
|
||||||
ButtonText=black
|
ButtonText=black
|
||||||
|
|
||||||
Base=red
|
Base=red
|
||||||
BaseText=white
|
BaseText=white
|
||||||
|
|
||||||
ThreedHighlight=#a0a0a0
|
ThreedHighlight=#a0a0a0
|
||||||
ThreedShadow1=#b0b0b0
|
ThreedShadow1=#b0b0b0
|
||||||
ThreedShadow2=#909090
|
ThreedShadow2=#909090
|
||||||
|
|
||||||
HoverHighlight=white
|
HoverHighlight=white
|
||||||
|
|
||||||
Selection=black
|
Selection=black
|
||||||
SelectionText=white
|
SelectionText=white
|
||||||
|
|
|
@ -1,39 +1,31 @@
|
||||||
[Colors]
|
[Colors]
|
||||||
DesktopBackground=#313819
|
DesktopBackground=#313819
|
||||||
|
|
||||||
ActiveWindowBorder1=#731013
|
ActiveWindowBorder1=#731013
|
||||||
ActiveWindowBorder2=#ee3532
|
ActiveWindowBorder2=#ee3532
|
||||||
ActiveWindowTitle=white
|
ActiveWindowTitle=white
|
||||||
|
|
||||||
InactiveWindowBorder1=#734546
|
InactiveWindowBorder1=#734546
|
||||||
InactiveWindowBorder2=#ee908f
|
InactiveWindowBorder2=#ee908f
|
||||||
InactiveWindowTitle=white
|
InactiveWindowTitle=white
|
||||||
|
|
||||||
MovingWindowBorder1=#a76f24
|
MovingWindowBorder1=#a76f24
|
||||||
MovingWindowBorder2=#eec666
|
MovingWindowBorder2=#eec666
|
||||||
MovingWindowTitle=white
|
MovingWindowTitle=white
|
||||||
|
|
||||||
HighlightWindowBorder1=#a76f24
|
HighlightWindowBorder1=#a76f24
|
||||||
HighlightWindowBorder2=#eec666
|
HighlightWindowBorder2=#eec666
|
||||||
HighlightWindowTitle=white
|
HighlightWindowTitle=white
|
||||||
|
|
||||||
MenuBase=#57691f
|
MenuBase=#57691f
|
||||||
|
MenuBaseText=white
|
||||||
MenuStripe=#2b3018
|
MenuStripe=#2b3018
|
||||||
MenuSelection=#ff8742
|
MenuSelection=#ff8742
|
||||||
|
MenuSelectionText=black
|
||||||
Window=#5a0103
|
Window=#5a0103
|
||||||
WindowText=white
|
WindowText=white
|
||||||
Button=#d46c64
|
Button=#d46c64
|
||||||
ButtonText=black
|
ButtonText=black
|
||||||
|
|
||||||
Base=#d3d7c4
|
Base=#d3d7c4
|
||||||
BaseText=black
|
BaseText=black
|
||||||
|
|
||||||
ThreedHighlight=#e69e99
|
ThreedHighlight=#e69e99
|
||||||
ThreedShadow1=#a24841
|
ThreedShadow1=#a24841
|
||||||
ThreedShadow2=#882d26
|
ThreedShadow2=#882d26
|
||||||
|
|
||||||
HoverHighlight=#e6e5e2
|
HoverHighlight=#e6e5e2
|
||||||
|
|
||||||
Selection=#84351a
|
Selection=#84351a
|
||||||
SelectionText=white
|
SelectionText=white
|
||||||
|
|
|
@ -29,7 +29,9 @@ public:
|
||||||
Color highlight_window_title() const { return color(ColorRole::HighlightWindowTitle); }
|
Color highlight_window_title() const { return color(ColorRole::HighlightWindowTitle); }
|
||||||
Color menu_stripe() const { return color(ColorRole::MenuStripe); }
|
Color menu_stripe() const { return color(ColorRole::MenuStripe); }
|
||||||
Color menu_base() const { return color(ColorRole::MenuBase); }
|
Color menu_base() const { return color(ColorRole::MenuBase); }
|
||||||
|
Color menu_base_text() const { return color(ColorRole::MenuBaseText); }
|
||||||
Color menu_selection() const { return color(ColorRole::MenuSelection); }
|
Color menu_selection() const { return color(ColorRole::MenuSelection); }
|
||||||
|
Color menu_selection_text() const { return color(ColorRole::MenuSelectionText); }
|
||||||
Color base() const { return color(ColorRole::Base); }
|
Color base() const { return color(ColorRole::Base); }
|
||||||
Color base_text() const { return color(ColorRole::BaseText); }
|
Color base_text() const { return color(ColorRole::BaseText); }
|
||||||
Color button() const { return color(ColorRole::Button); }
|
Color button() const { return color(ColorRole::Button); }
|
||||||
|
|
|
@ -72,7 +72,9 @@ RefPtr<SharedBuffer> load_system_theme(const String& path)
|
||||||
DO_COLOR(HighlightWindowTitle);
|
DO_COLOR(HighlightWindowTitle);
|
||||||
DO_COLOR(MenuStripe);
|
DO_COLOR(MenuStripe);
|
||||||
DO_COLOR(MenuBase);
|
DO_COLOR(MenuBase);
|
||||||
|
DO_COLOR(MenuBaseText);
|
||||||
DO_COLOR(MenuSelection);
|
DO_COLOR(MenuSelection);
|
||||||
|
DO_COLOR(MenuSelectionText);
|
||||||
|
|
||||||
buffer->seal();
|
buffer->seal();
|
||||||
buffer->share_globally();
|
buffer->share_globally();
|
||||||
|
|
|
@ -21,7 +21,9 @@ enum class ColorRole {
|
||||||
HighlightWindowTitle,
|
HighlightWindowTitle,
|
||||||
MenuStripe,
|
MenuStripe,
|
||||||
MenuBase,
|
MenuBase,
|
||||||
|
MenuBaseText,
|
||||||
MenuSelection,
|
MenuSelection,
|
||||||
|
MenuSelectionText,
|
||||||
Window,
|
Window,
|
||||||
WindowText,
|
WindowText,
|
||||||
Button,
|
Button,
|
||||||
|
|
|
@ -154,11 +154,11 @@ void WSMenu::draw()
|
||||||
|
|
||||||
for (auto& item : m_items) {
|
for (auto& item : m_items) {
|
||||||
if (item.type() == WSMenuItem::Text) {
|
if (item.type() == WSMenuItem::Text) {
|
||||||
Color text_color = palette.window_text();
|
Color text_color = palette.menu_base_text();
|
||||||
if (&item == m_hovered_item && item.is_enabled()) {
|
if (&item == m_hovered_item && item.is_enabled()) {
|
||||||
painter.fill_rect(item.rect(), palette.menu_selection());
|
painter.fill_rect(item.rect(), palette.menu_selection());
|
||||||
painter.draw_rect(item.rect(), palette.menu_selection().darkened());
|
painter.draw_rect(item.rect(), palette.menu_selection().darkened());
|
||||||
text_color = Color::White;
|
text_color = palette.menu_selection_text();
|
||||||
} else if (!item.is_enabled()) {
|
} else if (!item.is_enabled()) {
|
||||||
text_color = Color::MidGray;
|
text_color = Color::MidGray;
|
||||||
}
|
}
|
||||||
|
@ -190,7 +190,7 @@ void WSMenu::draw()
|
||||||
s_submenu_arrow_bitmap_height
|
s_submenu_arrow_bitmap_height
|
||||||
};
|
};
|
||||||
submenu_arrow_rect.center_vertically_within(item.rect());
|
submenu_arrow_rect.center_vertically_within(item.rect());
|
||||||
painter.draw_bitmap(submenu_arrow_rect.location(), submenu_arrow_bitmap, palette.window_text());
|
painter.draw_bitmap(submenu_arrow_rect.location(), submenu_arrow_bitmap, text_color);
|
||||||
}
|
}
|
||||||
} else if (item.type() == WSMenuItem::Separator) {
|
} else if (item.type() == WSMenuItem::Separator) {
|
||||||
Point p1(item.rect().translated(stripe_rect.width() + 4, 0).x(), item.rect().center().y() - 1);
|
Point p1(item.rect().translated(stripe_rect.width() + 4, 0).x(), item.rect().center().y() - 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue