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! :^)
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().
Previously they would resort based on the column immediately when you
mousedown on them. Now we track the click event and show the header
in a pressed state, etc. The usual button stuff :^)
Before bringing up the context menu, clicking...
- ...on an already selected item leaves selection alone
- ...on an unselected item makes it the only selected item
- ...outside any item clears the selection
You can now set a GTableCellPaintingDelegate per column in GTableView.
For columns with a painting delegate set, the view will defer to the
delegate for painting each cell in that column.
You can now call GTableView::set_size_columns_to_fit_content(true) and
the table columns will grow to fit the content. They will never shrink,
only grow.
This means I can spend a lot less time fidgeting with column widths :^)
I originally thought I'd have to implement text clipping in Painter for
this, but it seems like I can get away without doing that today. :^)
Fixes#390.