Commit Graph

71 Commits

Author SHA1 Message Date
Matthias Clasen
5a01208f55 GtkHeaderBar: Queue a resize when pack-type is changed
Otherwise, buttons appear to stick to the wrong side in glade.
2014-11-06 01:05:51 -05:00
Matthias Clasen
e2882e4845 GtkHeaderBar: Make the position child property writable
Glade asssumes that it is, and without this, rearranging children
in glade is very cumbersome.
2014-11-04 16:56:25 -05:00
Matthias Clasen
2873195644 GtkHeaderBar: Fix a corner-case in child properties
The child property setting must be prepared to deal with any
child property for any child, even if it doesn't make sense,
like the pack-type for the custom title. This is happening
in glade when undoing a change in the custom-title property.
2014-11-02 17:49:47 -05:00
Matthias Clasen
3404e92312 GtkHeaderBar: Update separator visibility when needed
We need to be a little more forthcoming with showing and hiding
the separators - their visibility now depends on the the visibility
and pack type of the regular headerbar children. This was observed
in gnome-contacts, where headerbar buttons are shown and hidden.
2014-08-28 22:54:18 -04:00
Nikita Churaev
684b981fb5 Only show title button separator when there is something to separate
https://bugzilla.gnome.org/show_bug.cgi?id=729636
2014-08-08 23:02:14 +02:00
Matthias Clasen
9d527c83aa GtkHeaderBar: Use defines for style classes 2014-07-04 19:06:08 -04:00
Matthias Clasen
baea175628 GtkHeaderBar: Don't forget to show the subtitle
https://bugzilla.gnome.org/show_bug.cgi?id=731790
2014-06-18 11:56:08 -04:00
Matthias Clasen
d1f6858b36 GtkHeaderBar: Use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:31:04 -04:00
Matthias Clasen
d1d2763d00 GtkHeaderBar: Allow overdrawing
The draw function of GtkHeaderBar was returning TRUE, causing
after-signal handlers to not run. This breaks e.g. drawing of
dnd hightlights. Fix that.
2014-05-03 13:16:46 -04:00
Benjamin Otte
209781ae3c headerbar: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:28 +02:00
Volker Sobek
0940cbbeb9 docs: Fix parameter names for two functions
Don't use two different parameter names.
2014-04-21 22:57:35 +02:00
Yosef Or Boczko
900adae5d9 headerbar: Use popover for the fallback app menu
https://bugzilla.gnome.org/show_bug.cgi?id=723963
2014-04-06 02:23:19 -04:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
Matthias Clasen
c5874b1034 Document gtk_header_bar_get_has_subtitle 2014-02-19 01:03:37 -05:00
Matthias Clasen
e179c65da0 header bar: squeeze the title in
Let the center widget extend into the border area, to avoid
resizing header bars needlessly. This improves the uniformity
of header bars across applications, some of which don't use
subtitles, or use custom title widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=706515
https://bugzilla.gnome.org/show_bug.cgi?id=707999
2014-02-14 15:39:08 -05:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
Murray Cumming
a220871250 docs: Improve grammar in GtkHeaderBar overview 2014-01-31 11:24:34 +01:00
Matthias Clasen
6e96111d9f GtkHeaderBar: try harder to find the best window icon
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
2014-01-24 15:40:37 -05:00
Yosef Or Boczko
773e40ca7b docs: Add more a reference in GtkHeaderBar 2014-01-23 18:29:31 +02:00
William Jon McCann
0a416c7559 docs: avoid ambiguous return tags 2014-01-21 12:41:16 -05:00
Matthias Clasen
679883e098 Make sure title_bar_with is initialized
With a hidden custom title, we failed to initialize
the title_bar_width variables.
2014-01-18 17:58:44 -05:00
Volker Sobek
a4d69e7f14 docs/comments: Fix spelling of 'explicitly'
This replaces all occurrences of 'explicitely' with 'explicitly'. Only
code comments and gtk-doc statements are affected.

https://bugzilla.gnome.org/show_bug.cgi?id=722429
2014-01-18 03:47:46 +01:00
Matthias Clasen
b73d291086 header bar: Make it possible to have no title
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
2014-01-17 19:52:29 -05:00
William Jon McCann
24aa40ed35 headerbar: Set a minimum size for the title
https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:06 -05:00
Cosimo Cecchi
197785744b window: add an is-maximized property to GtkWindow
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
2014-01-13 23:13:37 -05:00
Matthias Clasen
c3e91c7031 GtkHeaderBar: Fix positioning of pack-end widgets
This makes the positioning of pack-start and pack-end
widgets symmetric.
2014-01-06 23:37:18 -05:00
Matthias Clasen
2602372401 Be more careful when parsing gtk-decoration-layout
When the string is empty, breaking it at : will not give
us two tokens, and we were parsing garbage, leading to crash.
https://bugzilla.gnome.org/show_bug.cgi?id=721635
2014-01-06 17:07:21 -05:00
Matthias Clasen
f723113127 GtkHeaderBar: Refresh window buttons when settings change
We already do this when the shell-shows-menu settings changes,
but we forgot to do the same for the decoration layout.
2014-01-06 10:32:18 -05:00
Matthias Clasen
7e1a4800fa Redo header bar decorations once more
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.
2013-12-21 21:58:24 -05:00
Matthias Clasen
18d439ee40 Allow close buttons on dialogs
It was a long-standing problem for some users of GtkDialog that
there is no guaranted way to close it. So, lets show a close
button.
2013-12-20 13:31:08 -05:00
Matthias Clasen
1ccbca42d0 GtkHeaderBar: Fix allocation of start and end boxes
We were giving these boxes too much width, consuming what
was supposed to be the spacing between the boxes and the
other content of the header bar.
2013-12-16 20:36:22 -05:00
Matthias Clasen
ea8bb7e0ea GtkHeaderBar: Center buttons
Header bars can get taller than the buttons require, and we don't
want them to extend all the way. Center them instead.
2013-12-14 22:32:11 -05:00
Matthias Clasen
269282257d GtkHeaderBar: fix flipping of window controls
We were not keepign the separators at the inside.
2013-12-14 18:30:10 -05:00
Matthias Clasen
f3d22d2a9b Make app menu fallback a bit more reliable
If the theme has no 'menu' control in the window decorations,
show the menubar after all.
2013-12-13 01:21:06 -05:00
Jasper St. Pierre
cf8fb209e3 headerbar: Don't add hidden widgets
This is a much simpler fix.
2013-12-13 01:11:27 -05:00
Jasper St. Pierre
a3933f96eb Revert "GtkHeaderBar: don't show dangling separators"
This reverts commit a33e5748db.
2013-12-13 01:09:42 -05:00
Matthias Clasen
a33e5748db GtkHeaderBar: don't show dangling separators
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.
2013-12-13 01:02:36 -05:00
Matthias Clasen
dc073b8020 Make window icons work in GtkHeaderBar 2013-12-13 01:02:36 -05:00
Jasper St. Pierre
ec61f290dc headerbar: Respect the show-close-button property 2013-12-12 21:55:06 -05:00
Jasper St. Pierre
d9f92424b2 headerbar: Support all kinds of CSD decorations
Move the gtkwindow.c CSD code into GtkHeaderBar, and make it triggerable
by the show-close-button property, and remove shows-fallback-app-menu.

https://bugzilla.gnome.org/show_bug.cgi?id=720233
2013-12-12 19:30:59 -05:00
Matthias Clasen
d8401c5f0a GtkHeaderBar: treat "" as 'no subtitle'
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.
2013-12-12 19:29:52 -05:00
Jasper St. Pierre
37baeed66e headerbar: Remove unused private API
Don't remove gtkheaderbarprivate.h, even though it's empty,
since we'll add more to it soon.

https://bugzilla.gnome.org/show_bug.cgi?id=720233
2013-12-11 19:28:30 -05:00
Matthias Clasen
50a206223f Trivial typo fix 2013-12-10 23:03:12 -05:00
Matthias Clasen
1a6a86a867 GtkHeaderBar: Add a ::has-subtitle property
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.
2013-12-10 23:03:12 -05:00
Matthias Clasen
d297500976 Use window icons for fallback
When the window has an icon, use it for the fallback menu
button.
2013-11-16 17:04:30 -05:00
Matthias Clasen
07d71cf945 Small doc improvements 2013-11-16 15:00:16 -05:00
Matthias Clasen
805bf49be9 Trivial whitespace fix 2013-11-16 14:52:21 -05:00
Matthias Clasen
2863bb287c GtkHeaderBar: Add a fallback app menu implementation
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.
2013-11-16 01:50:39 -05:00
Bastien Nocera
f5291660e0 Fix possible crash in header bar
When the header bar's top-level widget is not a GtkWindow,
don't try to get the inexistant "decoration-button-layout"
property.
2013-09-27 17:27:31 +02:00
Matthias Clasen
dab146fe30 Add accessible names to csd buttons
Its the right thing to do.
2013-09-20 15:02:17 -04:00