summaryrefslogtreecommitdiff
path: root/Applications/IRCClient
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-12-23 20:24:26 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-12-23 20:33:01 +0100
commit411058b2a3c5a1058ac5c2e54ec53dba12e198e4 (patch)
tree6288fb17845f38fd966332b9fd47182e6b75a356 /Applications/IRCClient
parent7c8bbea995d9e2a5580c66cca7e8a56f65329fc2 (diff)
downloadserenity-411058b2a3c5a1058ac5c2e54ec53dba12e198e4.zip
WindowServer+LibGUI: Implement basic color theming
Color themes are loaded from .ini files in /res/themes/ The theme can be switched from the "Themes" section in the system menu. The basic mechanism is that WindowServer broadcasts a SharedBuffer with all of the color values of the current theme. Clients receive this with the response to their initial WindowServer::Greet handshake. When the theme is changed, WindowServer tells everyone by sending out an UpdateSystemTheme message with a new SharedBuffer to use. This does feel somewhat bloated somehow, but I'm sure we can iterate on it over time and improve things. To get one of the theme colors, use the Color(SystemColor) constructor: painter.fill_rect(rect, SystemColor::HoverHighlight); Some things don't work 100% right without a reboot. Specifically, when constructing a GWidget, it will set its own background and foreground colors based on the current SystemColor::Window and SystemColor::Text. The widget is then stuck with these values, and they don't update on system theme change, only on app restart. All in all though, this is pretty cool. Merry Christmas! :^)
Diffstat (limited to 'Applications/IRCClient')
-rw-r--r--Applications/IRCClient/IRCAppWindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Applications/IRCClient/IRCAppWindow.cpp b/Applications/IRCClient/IRCAppWindow.cpp
index a2671b50b3..3cb8c861ee 100644
--- a/Applications/IRCClient/IRCAppWindow.cpp
+++ b/Applications/IRCClient/IRCAppWindow.cpp
@@ -156,7 +156,7 @@ void IRCAppWindow::setup_widgets()
auto widget = GWidget::construct();
set_main_widget(widget);
widget->set_fill_with_background_color(true);
- widget->set_background_color(Color::WarmGray);
+ widget->set_background_color(SystemColor::Window);
widget->set_layout(make<GBoxLayout>(Orientation::Vertical));
widget->layout()->set_spacing(0);