1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:37:42 +00:00
serenity/Libraries/LibDraw
Andreas Kling 411058b2a3 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! :^)
2019-12-23 20:33:01 +01:00
..
CharacterBitmap.cpp LibDraw: Introduce (formerly known as SharedGraphics.) 2019-07-18 10:18:16 +02:00
CharacterBitmap.h LibDraw: Introduce (formerly known as SharedGraphics.) 2019-07-18 10:18:16 +02:00
Color.cpp WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
Color.h WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
DisjointRectSet.cpp LibDraw: Introduce (formerly known as SharedGraphics.) 2019-07-18 10:18:16 +02:00
DisjointRectSet.h LibDraw: Introduce (formerly known as SharedGraphics.) 2019-07-18 10:18:16 +02:00
Emoji.cpp LibDraw: Store emojis in a HashMap<u32, RefPtr<GraphicsBitmap>> 2019-10-19 18:36:45 +02:00
Emoji.h LibDraw: Store emojis in a HashMap<u32, RefPtr<GraphicsBitmap>> 2019-10-19 18:36:45 +02:00
FloatPoint.h LibDraw: Add FloatPoint, FloatSize and FloatRect 2019-10-20 12:55:55 +02:00
FloatRect.h LibDraw: Add FloatPoint, FloatSize and FloatRect 2019-10-20 12:55:55 +02:00
FloatSize.h LibDraw: Add FloatPoint, FloatSize and FloatRect 2019-10-20 12:55:55 +02:00
Font.cpp AK: Use size_t for the length of strings 2019-12-09 17:51:21 +01:00
Font.h AK: Rename <AK/AKString.h> to <AK/String.h> 2019-09-06 15:36:54 +02:00
GIFLoader.cpp LibDraw: Start work on a GIF decoder (not yet functional!) 2019-11-23 16:50:21 +01:00
GIFLoader.h LibDraw: Start work on a GIF decoder (not yet functional!) 2019-11-23 16:50:21 +01:00
GraphicsBitmap.cpp LibDraw: Add GraphicsBitmap::create_purgeable() 2019-12-18 20:50:05 +01:00
GraphicsBitmap.h LibDraw: Add GraphicsBitmap::create_purgeable() 2019-12-18 20:50:05 +01:00
ImageDecoder.cpp LibDraw: Rename ImageLoader => ImageDecoder 2019-10-19 20:54:47 +02:00
ImageDecoder.h LibDraw: Create purgeable GraphicsBitmap in the PNG decoder 2019-12-18 20:50:58 +01:00
Makefile WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
Orientation.h LibDraw: Move the Orientation enum to its own LibDraw header file. 2019-07-20 19:32:12 +02:00
Painter.cpp LibDraw: Painter::draw_pixel() with thickness>1 was doubly translating 2019-11-29 22:31:45 +01:00
Painter.h LibDraw: Support dotted lines in Painter::draw_line() 2019-11-27 20:52:11 +01:00
PNGLoader.cpp LibDraw: Create purgeable GraphicsBitmap in the PNG decoder 2019-12-18 20:50:58 +01:00
PNGLoader.h LibDraw: Create purgeable GraphicsBitmap in the PNG decoder 2019-12-18 20:50:58 +01:00
Point.h LibDraw: Remove convenience functions for the old WindowServer IPC 2019-12-02 11:11:05 +01:00
Rect.cpp LibDraw: Add TextAlignment::TopRight 2019-09-06 19:23:54 +02:00
Rect.h LibDraw: Add a way to check for horizontal/vertical Rect intersections 2019-12-13 23:36:17 +01:00
Size.h LibDraw: Remove convenience functions for the old WindowServer IPC 2019-12-02 11:11:05 +01:00
StylePainter.cpp WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
StylePainter.h WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
SystemTheme.cpp WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
SystemTheme.h WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
TextAlignment.h LibDraw: Add TextAlignment::TopRight 2019-09-06 19:23:54 +02:00
TextElision.h LibDraw: Introduce (formerly known as SharedGraphics.) 2019-07-18 10:18:16 +02:00