Commit Graph

29 Commits

Author SHA1 Message Date
William Jon McCann
4b1838bde6 Fix positioning of up menu button popup
Use the menu allocation instead of the request size.

https://bugzilla.gnome.org/show_bug.cgi?id=720939
2014-01-06 12:44:59 -05:00
Matthias Clasen
6a7670efe5 Nicer nicks for GtkMenuButton properties
Requested in
https://bugzilla.gnome.org/show_bug.cgi?id=720945
2014-01-04 23:36:12 -05:00
Matthias Clasen
f200eebfd6 Improve menubutton a11y
The button now claims its menu as a child for a11y purposes,
which makes it possible for ATs to see it when the navigate
the tree top-down.

Update the a11y test to match.
2013-12-20 13:31:08 -05:00
Matthias Clasen
2c007a8691 Set an accessible name on menu buttons
These commonly have just an image in them, so lets at least
call them 'Menu'.
2013-12-20 13:31:08 -05:00
Matthias Clasen
e5317f0f9a Improve struct packing in various places 2013-09-21 23:50:55 -04:00
Matthias Clasen
dc4f555d25 Fix keyboard activation of menu buttons
Keyboard activation relies on the menu not being visible,
so ensure that it isn't when the menu is attached.

Problem tracked down by Vincent Le Garrec,
https://bugzilla.gnome.org/show_bug.cgi?id=688738
2013-08-18 22:22:22 -04:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
Matthias Clasen
fff4c8e841 Documentation fixes
The documentation for GtkMenuButton was still referring to a
"menu" properties in several places, though it has been renamed
to "popup".
2013-01-13 08:27:20 -05:00
Paolo Borelli
1beb9db7b0 gtkmenubutton: remove weak pointer when needed
We must make sure to remove the weak pointer when disposing the widget
or when resetting the align widget otherwise glib will try to nullify
invalid memory.
2012-11-04 17:12:14 +01:00
Paolo Borelli
5830363787 gtkmenubutton: set menu to NULL in dispose.
Prevent menu to be detached multiple times.
2012-11-04 17:12:14 +01:00
Cosimo Cecchi
15fe3038be menubutton: don't refer to the non-existant menu property
7c6454246e removed the property, but
forgot to change the name in a g_object_notify().
2012-10-17 17:05:22 -04:00
Ignacio Casal Quinteiro
7c6454246e GtkMenuButton: remove menu property as it is replaced by popup.
See that it was already announced to be removed before 3.6.0
but we forgot.
2012-10-17 14:07:31 +02:00
Matthias Clasen
4b5db54fa7 Remove gtk_menu_button_[sg]et_menu
These functions were never in a stable release, and have
been renamed to gtk_menu_button_[sg]et_popup.
2012-09-24 00:08:30 -04:00
Matthias Clasen
0b11e08f87 Straigthen includes in gtkmenubutton.[hc]
Don't include gtk.h, but just include whats needed.
2012-09-24 00:01:39 -04:00
Matthias Clasen
d03ceb8b2c GtkMenuButton: improve rtl support
Show the menu at the side the arrow points to,
also in rtl locales.
https://bugzilla.gnome.org/show_bug.cgi?id=684606
2012-09-21 23:53:11 -04:00
Cosimo Cecchi
e34467a375 menubutton: set DROPDOWN_MENU hint on the menu toplevel
Restore the behavior introduced in
598163e526, which regressed in commit
5a3442bf9c.
2012-09-17 09:50:03 -04:00
Cosimo Cecchi
143a600466 menubutton: clear arrow_widget on remove()
So that we clear its pointer also in case somebody else calls
gtk_container_remove() on the button.
Fixes criticals at startup in e.g. Nautilus.
2012-09-04 09:38:28 -04:00
Matthias Clasen
95f64a4d4d Revert "menubutton: make it work with custom content in .ui file"
This reverts commit 6e6487b461.
2012-08-31 23:10:30 -04:00
Matthias Clasen
9e4b550c98 GtkMenuButton: Override add
By removing an existing child in add, if it is our own arrow,
we can make things work better in GtkBuilder.

https://bugzilla.gnome.org/show_bug.cgi?id=682291
2012-08-31 22:58:25 -04:00
David Zeuthen
6e6487b461 menubutton: make it work with custom content in .ui file
This was reported in bug 682291.

https://bugzilla.gnome.org/show_bug.cgi?id=682291

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-08-31 22:58:10 -04:00
Ryan Lortie
0244dc8017 GtkMenuButton: rename _set_menu() to _set_popup()
It's too close to the release so we'll keep _set_menu() around, but
deprecate it, pointing to the new API.  It will be removed (and the name
reused) before the 3.6.0 release.

https://bugzilla.gnome.org/show_bug.cgi?id=682235
2012-08-20 17:04:14 -04:00
Matthias Clasen
5a3442bf9c Improve GtkMenuButton menu positioning
Take the menu halign/valign into consideration when positioning
the menu. Also, document the various combinations.

https://bugzilla.gnome.org/show_bug.cgi?id=680988
2012-08-06 22:27:48 -04:00
Jasper St. Pierre
844e793246 menubutton: Clear references in dispose, not finalize
We need to do this here so that an explicit gtk_widget_destroy
on either the widget or a container that holds it will kill the
reference to the menu or model.

https://bugzilla.gnome.org/show_bug.cgi?id=680803
2012-07-31 12:09:05 -03:00
Matthias Clasen
1bcefc47e1 Cosmetic changes 2012-07-13 23:07:25 -04:00
Cosimo Cecchi
598163e526 menubutton: set DROPDOWN_MENU hint on the menu toplevel
So the WM can render the menu shadows correctly, omitting the top side,
in the common case the menu is rendered down from a toolbar.

https://bugzilla.gnome.org/show_bug.cgi?id=679449
2012-07-05 10:16:42 -04:00
Cosimo Cecchi
d22624b18e menubutton: don't dereference NULL GdkEvent
Since we explictly call popup_menu with NULL when it's
keyboard-activated, we need to be careful and not access event->device
without checking for event != NULL before.
2012-06-29 18:30:53 -04:00
Bastien Nocera
9fef2dc0d1 gtkmenubutton: Add menu button widget
As used in Totem and gnome-contacts. The widget
takes either a GtkMenu or a GMenuModel to construct
its menu, and can be given a parent widget to use to
position the drop-down (as used in GtkMenuToolButton).

https://bugzilla.gnome.org/show_bug.cgi?id=668013
2012-06-15 17:24:42 +01:00
Matthias Clasen
2baba250b8 Revert "gtkmenubutton: Add menu button widget"
This reverts commit 9d35f7e512.
2012-05-30 14:45:24 -04:00
Bastien Nocera
9d35f7e512 gtkmenubutton: Add menu button widget
As used in Totem and gnome-contacts. The widget
takes either a GtkMenu or a GMenuModel to construct
its menu, and can be given a parent widget to use to
position the drop-down (as used in GtkMenuToolButton).

https://bugzilla.gnome.org/show_bug.cgi?id=668013
2012-05-30 13:46:40 -04:00