GNOME Bugzilla – Bug 723014
wip: Make popover from menu model
Last modified: 2014-02-07 21:00:21 UTC
This translated a menu model into available widgetry to fill a popover.
Created attachment 267221 [details] [review] wip: Make popover from menu model This translated a menu model into available widgetry to fill a popover.
Created attachment 267222 [details] [review] Add a test for model-based popovers
Created attachment 267223 [details] screenshot
Created attachment 267224 [details] screenshot with submenu
instead of GtkExpanders I'd probably use something like the iTunes pop over menus, with a GtkStack and a left-to-right transition. it's much nicer and does not necessarily grow the pop over.
have a screenshot ?
fwiw, this is just the very raw, initial translation - I'm very open for suggestions how this should look and feel.
Created attachment 267230 [details] itunes 11 pop over song info pop over; "Add to" has a sub-menu.
Created attachment 267231 [details] itunes 11 pop over with sub-menu this is the "Add to" sub-menu. the first item is the name of the sub-menu, with a back arrow to return to the previous menu. the transition is left-to-right to enter the sub-menu, right-to-left to exit.
sadly, I could not find any GIF or video of the actual transition.
Created attachment 267270 [details] [review] wip: Make popover from menu model
Created attachment 267271 [details] [review] Add a test for model-based popovers
Created attachment 267272 [details] [review] Use a stack for submenus
Created attachment 267273 [details] screencast with submenu
that looks really great!
Review of attachment 267272 [details] [review]: ::: gtk/gtkpopover.c @@ +1804,3 @@ + sub_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); + gtk_container_add (GTK_CONTAINER (button), sub_box); + image = gtk_image_new_from_icon_name ("go-previous-symbolic", GTK_ICON_SIZE_MENU); Please, check the direction of the widget, and set the icon name to go-previous-rtl-symbolic if it RTL. @@ +1827,3 @@ + g_object_bind_property (item, "label", label, "label", G_BINDING_SYNC_CREATE); + gtk_container_add (GTK_CONTAINER (sub_box), label); + image = gtk_image_new_from_icon_name ("go-next-symbolic", GTK_ICON_SIZE_MENU); Please, check the direction of the widget, and set the icon name to go-next-rtl-symbolic if it RTL.
design input needed here
Created attachment 267375 [details] with relief = NONE
Created attachment 267376 [details] more relief none
(In reply to comment #18) > Created an attachment (id=267375) [details] > with relief = NONE I think we not want to the "Not action" string.
Created attachment 268123 [details] another attempt Here is another iteration, this one has some Adwaita support for theming these new buttons.
Created attachment 268124 [details] [review] wip: Make popover from menu model
Created attachment 268125 [details] [review] Add a test for model-based popovers
Created attachment 268126 [details] [review] Some theming support for popover menus
That looks pretty good in totem, minus the usual problems in totem itself.
I would add a "use-popover" property to GtkMenuButton to make it easier to use. GtkMenuButton already takes a GMenuModel.
yeah. my thoughts on this so far are: a) the menubutton api is not a perfect match here - it has a get_popup function which currently returns a GtkMenu when you set a menumodel. And the alignment properties won't really apply either b) We use a menu button internally in GtkHeaderBar, for app menu fallback. a menubutton property won't really help you there Overall, it would be much better if we could just fix the compositing issue
Created attachment 268437 [details] another iteration
Comment on attachment 268125 [details] [review] Add a test for model-based popovers Attachment 268125 [details] pushed as 59099cd - Add a test for model-based popovers