GtkWindow has 4 (!) APIs for setting window icons, and we
have to try them all in the right order to find the right
icon. This commit makes it so, and keeps the icon list
manipulation inside gtkwindow.c by adding a private API
for getting a single icon at the right size.
https://bugzilla.gnome.org/show_bug.cgi?id=722515
Add a custom title had the side-effect of showing the widget.
That is not right, adding children and managing their visibility
should be independent. The headerbar size allocation code also
made the assumption that a custom title is always visible.
With these changes, GtkHeaderBar should be usable in situations
where the centering functionality is not required, and it is
important to freely pack content at both ends, such as in nautilus.
https://bugzilla.gnome.org/show_bug.cgi?id=722340
With proper notifications, plus an accessor method for that state. This
allows client to just listen to notify::is-maximized instead of tracking
window-state-event.
https://bugzilla.gnome.org/show_bug.cgi?id=698786
Applications need a way to fix or adapt the decoration layout,
for situations like split header bars. Setting the layout from
the theme with a style property did not offer a good way to do
this, and the ::show-close-button property does not provide
fine-grained control.
To improve the situation, move the layout string to a property of
GtkHeaderBar which is backed by a setting. This allows platforms to
set a default button layout independent of the theme, while applications
can override the default.
The style GtkWindow style property is now deprecated and ignored.
If we don't have a window icon, we hide the titlebar_icon,
we still add it, so we can't simply go by the number of
children when deciding whether to show the separator or
now. Instead, update the separator visibility as we create
the various buttons.
This is one of the few cases where it makes some sense to blur
the line between and empty string and NULL: without this, it is
hard to reset the subtitle e.g. from a builder file. And we
have the has-subtitle property now to enforce subtitle size
allocation independently.
It is a fairly common case to just want a title, and not
reserve extra space for a subtitle. This is much easier
to get right by setting a boolean property than by
constructing a custom title widget.
Allow showing the fallback app menu with a menu button
in the header bar. Applications have to explicitly enable
this by calling gtk_header_bar_set_show_fallback_app_menu.
This allows GTK+ applications with headerbars to fit in
better in platforms that have window controls on the left.
To use this, set -GtkWindow-decoration-button-layout: 'close:'
in the theme.
https://bugzilla.gnome.org/show_bug.cgi?id=706708
The current theme just makes all text bold that appears anywhere
in a headerbar, which is not great. We add 'title' and 'subtitle'
style classes to allow more targeted overriding of the font.
Add a boolean property that controls whether a window close button
will be shown in the header bar or not. Doing this in the toolkit
will ensure consistency of the visual apperance.
https://bugzilla.gnome.org/show_bug.cgi?id=702971
The code was always adding a label widget as a child, but
then skipping over it in forall if a custom_title was present.
This confuses internal logic of GTK+ which assumes that it
can iterate over the entire widget hierarchy with forall,
to maintain state. Fix this by destroying the label when
a custom_title is set, and recreating it as needed.
This reverts commit 30a1a79322.
This turns out to be unnecessary when you can set the titlebar
on the window and let GtkWindow handle the events. As a benefit,
we get the window menu on custom titlebars for free.