summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/GToolBar.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-24LibGUI: Respect more system theme colors in GToolBarAndreas Kling
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-11-10GToolBar: Make buttons exclusive if action belongs to exclusive groupAndreas Kling
This was probably what I had originally intended when I first wrote the GActionGroup stuff, but it seems to have been forgotten.
2019-11-09LibGUI: Allow overriding the button size when constructing GToolBarAndreas Kling
This makes it easy to create a toolbar housing buttons of a size other than 16x16.
2019-11-09LibGUI: Allow construction of vertical GToolBarsAndreas Kling
There's currently a small paint glitch for vertical toolbars due to the way StylePainter::paint_surface() draws a MidGray line at the bottom of whatever a "surface" is supposed to be.
2019-09-21GButton: Convert most code to using ObjectPtr for GButtonAndreas Kling
2019-08-25LibGUI+TextEditor: Make GButton activate its action if presentAndreas Kling
Previously even if you assigned a GAction to a GButton, you still had to activate() the action manually by hooking the GButton::on_click callback.
2019-07-25LibCore: Introduce a C_OBJECT macro.Andreas Kling
This macro goes at the top of every CObject-derived class like so: class SomeClass : public CObject { C_OBJECT(SomeClass) public: ... At the moment, all it does is create an override for the class_name() getter but in the future this will be used to automatically insert member functions into these classes.
2019-07-20GWidget: Add set_preferred_size(width, height) overload.Andreas Kling
It was annoying to always write set_preferred_size({ width, height }). :^)
2019-07-11GToolBar: Make add_action() take a GAction& instead of NonnullRefPtr&&.Andreas Kling
There's very little reason to take NonnullRefPtr&& in arguments really. You can avoid ref-count churn in the cases where ownership is transferred from the caller to the callee, but that's a pretty unusual situation and not worth optimizing for at this stage.
2019-07-04Libraries: Create top level directory for libraries.Andreas Kling
Things were getting a little crowded in the project root, so this patch moves the Lib*/ directories into Libraries/.