summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/GAbstractColumnView.cpp
AgeCommit message (Collapse)Author
2019-12-24LibGUI+LibDraw: Add "Palette" concept for scoped color themingAndreas Kling
GApplication now has a palette. This palette contains all the system theme colors by default, and is inherited by a new top-level GWidget. New child widgets inherit their parents palette. It is possible to override the GApplication palette, and the palette of any GWidget. The Palette object contains a bunch of colors, each corresponding to a ColorRole. Each role has a convenience getter as well. Each GWidget now has a background_role() and foreground_role(), which are then looked up in their current palette when painting. This means that you no longer alter the background color of a widget by setting it directly, rather you alter either its background role, or the widget's palette.
2019-12-24LibDraw: Add Button and ButtonText system theme colorsAndreas Kling
These are now separate from the Window and WindowText colors.
2019-12-23WindowServer+LibGUI: Implement basic color themingAndreas Kling
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-14LibGUI: GAbstractColumnModel should never claim to hit a toggle boxAndreas Kling
Only GTreeView can hit a toggle box in index_at_event_position().
2019-12-13LibGUI: Make GTreeView inherit from GAbstractColumnViewAndreas Kling
This makes GTreeView able to support multi-column models! Only one column can be the "tree column", this is column 0 by default but can be changed by overriding GModel::tree_column().
2019-12-13LibGUI: Add a GAbstractColumnView base class for GTableViewAndreas Kling
Almost everything in GTableView moves up to GAbstractColumnView. This is in preparation for sharing a base class between GTableView and GTreeView :^)