After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 723014 - wip: Make popover from menu model
wip: Make popover from menu model
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-01-26 13:12 UTC by Matthias Clasen
Modified: 2014-02-07 21:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wip: Make popover from menu model (17.72 KB, patch)
2014-01-26 13:13 UTC, Matthias Clasen
none Details | Review
Add a test for model-based popovers (5.03 KB, patch)
2014-01-26 13:14 UTC, Matthias Clasen
none Details | Review
screenshot (21.56 KB, image/png)
2014-01-26 13:14 UTC, Matthias Clasen
  Details
screenshot with submenu (23.83 KB, image/png)
2014-01-26 13:16 UTC, Matthias Clasen
  Details
itunes 11 pop over (58.87 KB, image/png)
2014-01-26 14:58 UTC, Emmanuele Bassi (:ebassi)
  Details
itunes 11 pop over with sub-menu (39.40 KB, image/png)
2014-01-26 14:59 UTC, Emmanuele Bassi (:ebassi)
  Details
wip: Make popover from menu model (18.18 KB, patch)
2014-01-27 03:46 UTC, Matthias Clasen
none Details | Review
Add a test for model-based popovers (5.57 KB, patch)
2014-01-27 03:47 UTC, Matthias Clasen
none Details | Review
Use a stack for submenus (9.30 KB, patch)
2014-01-27 03:48 UTC, Matthias Clasen
none Details | Review
screencast with submenu (187.41 KB, video/webm)
2014-01-27 03:50 UTC, Matthias Clasen
  Details
with relief = NONE (19.79 KB, image/png)
2014-01-28 02:44 UTC, Matthias Clasen
  Details
more relief none (14.13 KB, image/png)
2014-01-28 02:45 UTC, Matthias Clasen
  Details
another attempt (185.06 KB, video/webm)
2014-02-05 06:07 UTC, Matthias Clasen
  Details
wip: Make popover from menu model (33.26 KB, patch)
2014-02-05 06:12 UTC, Matthias Clasen
none Details | Review
Add a test for model-based popovers (6.83 KB, patch)
2014-02-05 06:13 UTC, Matthias Clasen
committed Details | Review
Some theming support for popover menus (5.87 KB, patch)
2014-02-05 06:16 UTC, Matthias Clasen
none Details | Review
another iteration (1.37 MB, video/webm)
2014-02-07 18:16 UTC, Matthias Clasen
  Details

Description Matthias Clasen 2014-01-26 13:12:22 UTC
This translated a menu model into available widgetry
to fill a popover.
Comment 1 Matthias Clasen 2014-01-26 13:13:42 UTC
Created attachment 267221 [details] [review]
wip: Make popover from menu model

This translated a menu model into available widgetry
to fill a popover.
Comment 2 Matthias Clasen 2014-01-26 13:14:10 UTC
Created attachment 267222 [details] [review]
Add a test for model-based popovers
Comment 3 Matthias Clasen 2014-01-26 13:14:50 UTC
Created attachment 267223 [details]
screenshot
Comment 4 Matthias Clasen 2014-01-26 13:16:12 UTC
Created attachment 267224 [details]
screenshot with submenu
Comment 5 Emmanuele Bassi (:ebassi) 2014-01-26 14:17:36 UTC
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.
Comment 6 Matthias Clasen 2014-01-26 14:35:59 UTC
have a screenshot ?
Comment 7 Matthias Clasen 2014-01-26 14:36:29 UTC
fwiw, this is just the very raw, initial translation - I'm very open for suggestions how this should look and feel.
Comment 8 Emmanuele Bassi (:ebassi) 2014-01-26 14:58:16 UTC
Created attachment 267230 [details]
itunes 11 pop over

song info pop over; "Add to" has a sub-menu.
Comment 9 Emmanuele Bassi (:ebassi) 2014-01-26 14:59:45 UTC
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.
Comment 10 Emmanuele Bassi (:ebassi) 2014-01-26 15:00:25 UTC
sadly, I could not find any GIF or video of the actual transition.
Comment 11 Matthias Clasen 2014-01-27 03:46:47 UTC
Created attachment 267270 [details] [review]
wip: Make popover from menu model
Comment 12 Matthias Clasen 2014-01-27 03:47:33 UTC
Created attachment 267271 [details] [review]
Add a test for model-based popovers
Comment 13 Matthias Clasen 2014-01-27 03:48:08 UTC
Created attachment 267272 [details] [review]
Use a stack for submenus
Comment 14 Matthias Clasen 2014-01-27 03:50:26 UTC
Created attachment 267273 [details]
screencast with submenu
Comment 15 Emmanuele Bassi (:ebassi) 2014-01-27 10:37:08 UTC
that looks really great!
Comment 16 Yosef Or Boczko 2014-01-27 11:52:56 UTC
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.
Comment 17 Matthias Clasen 2014-01-27 13:50:29 UTC
design input needed here
Comment 18 Matthias Clasen 2014-01-28 02:44:10 UTC
Created attachment 267375 [details]
with relief = NONE
Comment 19 Matthias Clasen 2014-01-28 02:45:01 UTC
Created attachment 267376 [details]
more relief none
Comment 20 Yosef Or Boczko 2014-01-28 02:47:35 UTC
(In reply to comment #18)
> Created an attachment (id=267375) [details]
> with relief = NONE

I think we not want to the "Not action" string.
Comment 21 Matthias Clasen 2014-02-05 06:07:39 UTC
Created attachment 268123 [details]
another attempt

Here is another iteration, this one has some Adwaita support for theming these new buttons.
Comment 22 Matthias Clasen 2014-02-05 06:12:23 UTC
Created attachment 268124 [details] [review]
wip: Make popover from menu model
Comment 23 Matthias Clasen 2014-02-05 06:13:51 UTC
Created attachment 268125 [details] [review]
Add a test for model-based popovers
Comment 24 Matthias Clasen 2014-02-05 06:16:14 UTC
Created attachment 268126 [details] [review]
Some theming support for popover menus
Comment 25 Bastien Nocera 2014-02-05 09:02:51 UTC
That looks pretty good in totem, minus the usual problems in totem itself.
Comment 26 Bastien Nocera 2014-02-05 11:51:30 UTC
I would add a "use-popover" property to GtkMenuButton to make it easier to use. GtkMenuButton already takes a GMenuModel.
Comment 27 Matthias Clasen 2014-02-05 12:40:51 UTC
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
Comment 28 Matthias Clasen 2014-02-07 18:16:01 UTC
Created attachment 268437 [details]
another iteration
Comment 29 Matthias Clasen 2014-02-07 20:12:08 UTC
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