[tali] Move undo move from the app menu to the header bar
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tali] Move undo move from the app menu to the header bar
- Date: Sun, 16 Feb 2014 17:18:31 +0000 (UTC)
commit 49887233f7253195e090a8cac147d615f2898c65
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sun Feb 16 11:17:29 2014 -0600
Move undo move from the app menu to the header bar
I *think* Tali is the only remaining game that still has Undo in the app
menu....
src/gyahtzee.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/gyahtzee.c b/src/gyahtzee.c
index 277f583..1efd1a8 100644
--- a/src/gyahtzee.c
+++ b/src/gyahtzee.c
@@ -715,6 +715,7 @@ GyahtzeeCreateMainWindow (void)
GtkWidget *toolbar;
GtkWidget *tmp;
GtkWidget *dicebox;
+ GtkWidget *undo_button;
GMenu *app_menu, *section;
int i, j;
@@ -740,7 +741,6 @@ GyahtzeeCreateMainWindow (void)
section = g_menu_new ();
g_menu_append_section (app_menu, NULL, G_MENU_MODEL (section));
g_menu_append (section, _("_New Game"), "app.new-game");
- g_menu_append (section, _("_Undo Move"), "app.undo");
g_menu_append (section, _("_Preferences"), "app.preferences");
g_menu_append (section, _("_Scores"), "app.scores");
section = g_menu_new ();
@@ -760,6 +760,16 @@ GyahtzeeCreateMainWindow (void)
gtk_widget_show (hbar);
gtk_window_set_titlebar (GTK_WINDOW (window), hbar);
+ if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL)
+ undo_button = gtk_button_new_from_icon_name ("edit-undo-rtl-symbolic", GTK_ICON_SIZE_BUTTON);
+ else
+ undo_button = gtk_button_new_from_icon_name ("edit-undo-symbolic", GTK_ICON_SIZE_BUTTON);
+ gtk_widget_set_valign (undo_button, GTK_ALIGN_CENTER);
+ gtk_actionable_set_action_name (GTK_ACTIONABLE (undo_button), "app.undo");
+ gtk_widget_set_tooltip_text (undo_button, _("Undo your most recent move"));
+ gtk_widget_show (undo_button);
+ gtk_header_bar_pack_start (GTK_HEADER_BAR (hbar), undo_button);
+
/*---- Content ----*/
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]