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 732658 - Don't use app menu / HeaderBar on shells that don't support it well
Don't use app menu / HeaderBar on shells that don't support it well
Status: RESOLVED FIXED
Product: gnome-mahjongg
Classification: Applications
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-mahjongg-maint
gnome-mahjongg-maint
Depends on:
Blocks: 732655
 
 
Reported: 2014-07-03 00:30 UTC by Robert Ancell
Modified: 2014-07-07 00:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't show HeaderBar / app menu on shells that don't support it (8.41 KB, patch)
2014-07-03 00:31 UTC, Robert Ancell
none Details | Review
Don't show HeaderBar / app menu on shells that don't support it (7.72 KB, patch)
2014-07-03 00:53 UTC, Robert Ancell
needs-work Details | Review
Don't show HeaderBar / app menu on shells that don't support it (7.12 KB, patch)
2014-07-06 22:58 UTC, Robert Ancell
reviewed Details | Review

Description Robert Ancell 2014-07-03 00:30:56 UTC
Currently Mahjongg uses an application menu / GtkHeaderBar which looks great in
GNOME but not necessarily great in other shells (e.g. Unity). In those shells a
traditional menubar / decorations fit in better.
Comment 1 Robert Ancell 2014-07-03 00:31:40 UTC
Created attachment 279808 [details] [review]
Don't show HeaderBar / app menu on shells that don't support it

his is the patch we're shipping in Ubuntu so we can have new Mahjongg and it fits
into the Unity shell. For those running GNOME it looks the same as current
master.

I appreciate this might not fit in with the goals of the Mines project so I'll
leave it to the maintainers to decide if this is an appropriate upstream
addition. Obviously it adds some extra code / testing but I think it will
probably not grow in complexity over time.
Comment 2 Robert Ancell 2014-07-03 00:32:17 UTC
See bug #732655 which is the same thing for Mines. Probably best to keep the discussion in that bug as it's much the same thing.
Comment 3 Robert Ancell 2014-07-03 00:53:10 UTC
Created attachment 279811 [details] [review]
Don't show HeaderBar / app menu on shells that don't support it

Updated to only check gtk-shell-shows-menubar
Comment 4 Michael Catanzaro 2014-07-04 13:05:55 UTC
Review of attachment 279811 [details] [review]:

I think it looks better in Unity WITH the header bar. At least, the double title bar does not seem super natural to me.

But I'm fine with this if you're sure it's what you want.  Note that Mahjongg's preferences dialog still has a header bar (in master, not 3.12); I guess you probably don't want that?

::: src/gnome-mahjongg.vala
@@ +89,3 @@
 
+        bool shell_shows_menubar;
+        Gtk.Settings.get_default ().get ("gtk-shell-shows-app-menu", out shell_shows_menubar);

Oops, you mean gtk-shell-shows-menubar

@@ +142,3 @@
+        {
+            var menubar = new Gtk.MenuBar ();
+

In your Mines patch, you nest GLib.Menus and then call set_menu_bar(), can you do that here too? It's significantly more compact than creating a Gtk.MenuBar with a bunch of Gtk.MenuItems.
Comment 5 Robert Ancell 2014-07-06 22:58:33 UTC
Created attachment 280013 [details] [review]
Don't show HeaderBar / app menu on shells that don't support it

Fix GTK+ setting check, use Glib.Menu instead of Gtk.Menu, don't use HeaderBar for preferences dialog
Comment 6 Michael Catanzaro 2014-07-07 00:12:44 UTC
Review of attachment 280013 [details] [review]:

OK to push after fixing this nit:

::: src/gnome-mahjongg.vala
@@ +119,3 @@
         var title_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 2);
         title_box.pack_start (title, false, false, 0);
+        var alignment = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 0.0f);

Let's not use GtkAlignment since it was deprecated about a month ago... and I'm pretty sure it was evil anyway. halign is a better was to center widgets:

status_box.halign = Gtk.Align.CENTER;
Comment 7 Robert Ancell 2014-07-07 00:16:25 UTC
Thanks for the reviewing Michael!