[swell-foop] Conditionally display the New button in headerbar
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [swell-foop] Conditionally display the New button in headerbar
- Date: Sun, 8 Dec 2013 17:20:14 +0000 (UTC)
commit a5c8f78c79e7014ae64d23c48173a3583792694f
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sun Dec 8 11:17:19 2013 -0600
Conditionally display the New button in headerbar
If the app menu is displayed in the window, then this button is
redundant.
https://bugzilla.gnome.org/show_bug.cgi?id=720034
src/swell-foop.vala | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/src/swell-foop.vala b/src/swell-foop.vala
index 0310558..c91e53c 100644
--- a/src/swell-foop.vala
+++ b/src/swell-foop.vala
@@ -97,13 +97,16 @@ public class SwellFoop : Gtk.Application
headerbar.show_fallback_app_menu = true;
window.set_titlebar (headerbar);
- var new_game_button = new Gtk.Button ();
- new_game_button.label = _("_New");
- new_game_button.get_style_context ().add_class ("text-button");
- new_game_button.use_underline = true;
- new_game_button.action_name = "app.new-game";
- new_game_button.show ();
- headerbar.add (new_game_button);
+ if (Gtk.Settings.get_default ().gtk_shell_shows_app_menu)
+ {
+ var new_game_button = new Gtk.Button ();
+ new_game_button.label = _("_New");
+ new_game_button.get_style_context ().add_class ("text-button");
+ new_game_button.use_underline = true;
+ new_game_button.action_name = "app.new-game";
+ new_game_button.show ();
+ headerbar.add (new_game_button);
+ }
/* show the current score */
update_score_cb (0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]