1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:48:11 +00:00
serenity/Libraries/LibGUI
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
..
GAboutDialog.cpp LibCore: Make CObject reference-counted 2019-09-22 00:25:25 +02:00
GAboutDialog.h LibGUI: Fix crash in GAboutDialog::show() 2019-09-29 20:37:02 +02:00
GAbstractButton.cpp LibCore: Remove CTimer::create() overloads in favor of construct() 2019-09-21 18:13:17 +02:00
GAbstractButton.h LibCore: Remove ObjectPtr in favor of RefPtr 2019-09-22 00:31:54 +02:00
GAbstractColumnView.cpp WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
GAbstractColumnView.h LibGUI: Make GTreeView inherit from GAbstractColumnView 2019-12-13 23:36:36 +01:00
GAbstractView.cpp LibGUI: Allow override the font on a per-index basis in GListView 2019-10-22 21:38:04 +02:00
GAbstractView.h LibGUI: Add a GAbstractColumnView base class for GTableView 2019-12-13 20:54:40 +01:00
GAction.cpp LibGUI: Allow finding the source of a GAction activation 2019-12-09 21:29:43 +01:00
GAction.h LibGUI: Allow finding the source of a GAction activation 2019-12-09 21:29:43 +01:00
GActionGroup.cpp LibGUI: Add GActionGroup, a way to group a bunch of GActions. 2019-07-09 22:10:03 +02:00
GActionGroup.h LibGUI: Add GActionGroup, a way to group a bunch of GActions. 2019-07-09 22:10:03 +02:00
GApplication.cpp LibGUI: Move tooltip window rects if they don't end up on screen 2019-12-05 17:59:06 +01:00
GApplication.h LibGUI: Added window creation callback to GApplication/GWindow 2019-10-25 15:29:19 +02:00
GBoxLayout.cpp Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
GBoxLayout.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
GButton.cpp LibGUI: Allow finding the source of a GAction activation 2019-12-09 21:29:43 +01:00
GButton.h GButton: Make the constructors protected in favor of construct() 2019-09-21 19:37:38 +02:00
GCheckBox.cpp WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
GCheckBox.h LibGUI: Convert GCheckBox to ObjectPtr 2019-09-21 18:58:48 +02:00
GClipboard.cpp WindowServer: Port to the new IPC system 2019-12-02 11:11:05 +01:00
GClipboard.h WindowServer+LibGUI: Store a "data type" with the clipboard content 2019-09-14 09:19:05 +02:00
GComboBox.cpp GButton: Convert most code to using ObjectPtr for GButton 2019-09-21 19:28:28 +02:00
GComboBox.h LibCore: Remove ObjectPtr in favor of RefPtr 2019-09-22 00:31:54 +02:00
GCommand.cpp LibGUI: Add GUndoStack and GCommand classes 2019-11-30 15:36:17 +01:00
GCommand.h LibGUI: Add GUndoStack and GCommand classes 2019-11-30 15:36:17 +01:00
GDesktop.cpp WindowServer: Port to the new IPC system 2019-12-02 11:11:05 +01:00
GDesktop.h AK: Rename <AK/AKString.h> to <AK/String.h> 2019-09-06 15:36:54 +02:00
GDialog.cpp LibCore+LibGUI: Remove GEventLoop and use CEventLoop everywhere 2019-09-22 20:50:39 +02:00
GDialog.h LibCore+LibGUI: Remove GEventLoop and use CEventLoop everywhere 2019-09-22 20:50:39 +02:00
GDirectoryModel.cpp WindowServer+LibGUI: Add data_type and data fields to drag operations 2019-12-20 20:07:10 +01:00
GDirectoryModel.h FileManager: Added properties dialog 2019-11-20 23:23:57 +01:00
GDragOperation.cpp WindowServer+LibGUI: Add data_type and data fields to drag operations 2019-12-20 20:07:10 +01:00
GDragOperation.h WindowServer+LibGUI: Add data_type and data fields to drag operations 2019-12-20 20:07:10 +01:00
GEvent.h WindowServer+LibGUI: Add data_type and data fields to drag operations 2019-12-20 20:07:10 +01:00
GFilePicker.cpp WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
GFilePicker.h GFilePicker: Allow overriding the window title for get_open_filepath() 2019-10-26 21:42:34 +02:00
GFileSystemModel.cpp LibGUI: Add missing call to did_update() when updating GFileSystemModel 2019-12-12 22:41:28 +01:00
GFileSystemModel.h FileManager+LibGUI: Fix two folder-related crashes (#569) 2019-09-17 09:26:10 +02:00
GFontDatabase.cpp GFontDatabase: Iterate the font database in alphabetical order 2019-08-29 19:30:48 +02:00
GFontDatabase.h AK: Rename <AK/AKString.h> to <AK/String.h> 2019-09-06 15:36:54 +02:00
GFrame.cpp LibDraw: Introduce (formerly known as SharedGraphics.) 2019-07-18 10:18:16 +02:00
GFrame.h LibGUI: Convert GFrame to ObjectPtr 2019-09-21 19:21:36 +02:00
GGroupBox.cpp WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
GGroupBox.h LibGUI: Convert GGroupBox to ObjectPtr 2019-09-21 16:13:33 +02:00
GIcon.cpp LibGUI: Remove use of copy_ref(). 2019-07-11 15:49:47 +02:00
GIcon.h LibDraw: Introduce (formerly known as SharedGraphics.) 2019-07-18 10:18:16 +02:00
GInputBox.cpp LibCore: Make CObject reference-counted 2019-09-22 00:25:25 +02:00
GInputBox.h LibCore: Remove ObjectPtr in favor of RefPtr 2019-09-22 00:31:54 +02:00
GItemView.cpp WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
GItemView.h LibGUI+WindowServer: Start fleshing out drag&drop functionality 2019-12-08 16:50:23 +01:00
GJsonArrayModel.cpp AK: Allow JsonValue to store 64-bit integers internally 2019-10-29 16:36:50 +01:00
GJsonArrayModel.h GJsonArrayModel: Add hook for customizing the GModel::Role::Custom data 2019-08-14 20:30:18 +02:00
GLabel.cpp LibGUI: Fix move() of const StringView& 2019-09-16 07:49:43 +02:00
GLabel.h LibGUI: Make the GLabel constructors protected 2019-09-21 15:25:08 +02:00
GLayout.cpp LibCore+LibGUI: Allow inserting a CObject/GWidget before another 2019-11-05 20:41:27 +01:00
GLayout.h LibCore+LibGUI: Allow inserting a CObject/GWidget before another 2019-11-05 20:41:27 +01:00
GLazyWidget.cpp LibGUI: Add GLazyWidget, a convenience widget for lazily-built UI's 2019-10-02 20:24:29 +02:00
GLazyWidget.h LibGUI: Add GLazyWidget, a convenience widget for lazily-built UI's 2019-10-02 20:24:29 +02:00
GListView.cpp WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
GListView.h LibGUI: Allow specifying the model column for GListView and GComboBox 2019-08-05 18:32:04 +02:00
GMargins.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
GMenu.cpp LibGUI: Make GMenu inherit from CObject 2019-12-09 21:05:44 +01:00
GMenu.h LibGUI: Make GMenu inherit from CObject 2019-12-09 21:05:44 +01:00
GMenuBar.cpp LibGUI: Make GMenu inherit from CObject 2019-12-09 21:05:44 +01:00
GMenuBar.h LibGUI: Make GMenu inherit from CObject 2019-12-09 21:05:44 +01:00
GMenuItem.cpp LibGUI: Make GMenu inherit from CObject 2019-12-09 21:05:44 +01:00
GMenuItem.h LibGUI: Make GMenu inherit from CObject 2019-12-09 21:05:44 +01:00
GMessageBox.cpp LibCore: Remove ObjectPtr in favor of RefPtr 2019-09-22 00:31:54 +02:00
GMessageBox.h GMessageBox: Hide the constructor and fix broken usages 2019-09-30 17:20:53 +02:00
GModel.cpp LibGUI: Make GTreeView inherit from GAbstractColumnView 2019-12-13 23:36:36 +01:00
GModel.h WindowServer+LibGUI: Add data_type and data fields to drag operations 2019-12-20 20:07:10 +01:00
GModelEditingDelegate.h LibCore: Remove ObjectPtr in favor of RefPtr 2019-09-22 00:31:54 +02:00
GModelIndex.h LibGUI: Include internal_data() in GModelIndex LogStream output 2019-11-09 11:56:28 +01:00
GModelSelection.cpp GModelSelection: Add contains_row(int) and toggle(GModelIndex) 2019-09-07 19:33:58 +02:00
GModelSelection.h FileManager+LibGUI: Fix two folder-related crashes (#569) 2019-09-17 09:26:10 +02:00
GPainter.cpp Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
GPainter.h LibDraw: Introduce (formerly known as SharedGraphics.) 2019-07-18 10:18:16 +02:00
GProgressBar.cpp StylePainter: Move progress bar painting from GProgressBar to here 2019-08-14 20:31:46 +02:00
GProgressBar.h LibGUI: Convert GProgressBar to ObjectPtr 2019-09-21 16:31:12 +02:00
GRadioButton.cpp LibGUI: Add a simple GWidget class registry/factory 2019-11-10 12:57:37 +01:00
GRadioButton.h LibGUI: Add a simple GWidget class registry/factory 2019-11-10 12:57:37 +01:00
GResizeCorner.cpp WindowServer: Port to the new IPC system 2019-12-02 11:11:05 +01:00
GResizeCorner.h LibGUI: Convert GTextBox, GTextEditor and GResizeCorner to ObjectPtr 2019-09-21 15:46:47 +02:00
GScrollableWidget.cpp LibGUI: Add GScrollableWidget::to_widget_position() 2019-10-09 21:16:49 +02:00
GScrollableWidget.h LibGUI: Add GScrollableWidget::to_widget_position() 2019-10-09 21:16:49 +02:00
GScrollBar.cpp LibGUI: Add a simple GWidget class registry/factory 2019-11-10 12:57:37 +01:00
GScrollBar.h LibGUI: Add a simple GWidget class registry/factory 2019-11-10 12:57:37 +01:00
GShortcut.cpp Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
GShortcut.h AK: Rename <AK/AKString.h> to <AK/String.h> 2019-09-06 15:36:54 +02:00
GSlider.cpp LibGUI: Add a simple GWidget class registry/factory 2019-11-10 12:57:37 +01:00
GSlider.h LibGUI: Add a simple GWidget class registry/factory 2019-11-10 12:57:37 +01:00
GSortingProxyModel.cpp LibGUI: Make GSortingProxyModel update the selection on resort again 2019-11-27 19:04:35 +01:00
GSortingProxyModel.h GSortingProxyModel: Sort case insensitively by default (#441) 2019-08-11 18:11:25 +02:00
GSpinBox.cpp GButton: Convert most code to using ObjectPtr for GButton 2019-09-21 19:28:28 +02:00
GSpinBox.h LibCore: Remove ObjectPtr in favor of RefPtr 2019-09-22 00:31:54 +02:00
GSplitter.cpp WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
GSplitter.h LibGUI: Convert GSplitter to ObjectPtr 2019-09-21 16:11:02 +02:00
GStackWidget.cpp GStackWidget: Add a notification hook for when the active widget changes. 2019-07-07 21:50:38 +02:00
GStackWidget.h LibCore: Remove ObjectPtr in favor of RefPtr 2019-09-22 00:31:54 +02:00
GStatusBar.cpp LibGUI: Add very limited multi-label support to GStatusBar 2019-10-24 09:57:27 +02:00
GStatusBar.h LibGUI: Add very limited multi-label support to GStatusBar 2019-10-24 09:57:27 +02:00
GTableView.cpp WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
GTableView.h LibGUI: Add a GAbstractColumnView base class for GTableView 2019-12-13 20:54:40 +01:00
GTabWidget.cpp WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
GTabWidget.h LibCore: Remove ObjectPtr in favor of RefPtr 2019-09-22 00:31:54 +02:00
GTextBox.cpp Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
GTextBox.h LibGUI: Make GTextBox non-final 2019-10-28 19:08:48 +01:00
GTextDocument.cpp LibGUI: Add GTextDocument::range_for_entire_line() 2019-12-10 22:06:31 +01:00
GTextDocument.h LibGUI: Add GTextDocument::range_for_entire_line() 2019-12-10 22:06:31 +01:00
GTextEditor.cpp GTextEditor: Fix broken rendering of selection on wrapped lines 2019-12-17 21:15:10 +01:00
GTextEditor.h LibGUI: Make GMenu inherit from CObject 2019-12-09 21:05:44 +01:00
GTextPosition.h AK: Use size_t for the length of strings 2019-12-09 17:51:21 +01:00
GTextRange.h LibGUI: Move GTextPosition and GTextRange LogStream<< to their headers 2019-11-03 09:57:14 +01:00
GToolBar.cpp WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
GToolBar.h LibGUI: Allow overriding the button size when constructing GToolBar 2019-11-09 00:41:00 +01:00
GTreeView.cpp WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
GTreeView.h LibGUI: Fix GTreeView not showing the context menu 2019-12-15 17:02:44 +01:00
GUndoStack.cpp LibGUI: Add GUndoStack and GCommand classes 2019-11-30 15:36:17 +01:00
GUndoStack.h LibGUI: Add GUndoStack and GCommand classes 2019-11-30 15:36:17 +01:00
GVariant.cpp AK: Allow JsonValue to store 64-bit integers internally 2019-10-29 16:36:50 +01:00
GVariant.h LibGUI: Make it possible to wrap a Font in a GVariant 2019-10-22 21:37:11 +02:00
GWidget.cpp WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
GWidget.h LibGUI+WindowServer: Start fleshing out drag&drop functionality 2019-12-08 16:50:23 +01:00
GWindow.cpp WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
GWindow.h WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
GWindowServerConnection.cpp WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
GWindowServerConnection.h WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
GWindowType.h WindowServer+CPUGraph: Make menu applets be "regular" windows 2019-12-16 15:05:45 +01:00
Makefile Build: clean up build system, use one shared Makefile 2019-12-20 20:20:54 +01:00