[gnome-taquin] Add things that do nothing.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-taquin] Add things that do nothing.
- Date: Tue, 30 Jul 2019 17:12:10 +0000 (UTC)
commit e691dbbb1474d15190f2697da11e8551b4d0e4e6
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Tue Jul 30 16:40:13 2019 +0200
Add things that do nothing.
Syncing a bit with Iagno.
Remove also a call to the
hide_notification method.
src/game-headerbar.vala | 15 +++++++++++++--
src/game-window.vala | 11 ++++++-----
src/taquin-main.vala | 1 +
3 files changed, 20 insertions(+), 7 deletions(-)
---
diff --git a/src/game-headerbar.vala b/src/game-headerbar.vala
index 89c3327..8542ed9 100644
--- a/src/game-headerbar.vala
+++ b/src/game-headerbar.vala
@@ -47,6 +47,7 @@ private class GameHeaderBar : BaseHeaderBar, AdaptativeWidget
internal GameHeaderBar (string _window_name,
string _about_action_label,
GameWindowFlags flags,
+ GLib.Menu? _appearance_menu,
NightLightMonitor _night_light_monitor)
{
Object (about_action_label: _about_action_label,
@@ -56,6 +57,7 @@ private class GameHeaderBar : BaseHeaderBar, AdaptativeWidget
show_hint: GameWindowFlags.SHOW_HINT in flags,
show_redo: GameWindowFlags.SHOW_REDO in flags,
show_undo: GameWindowFlags.SHOW_UNDO in flags,
+ appearance_menu: _appearance_menu,
window_name: _window_name);
}
@@ -164,16 +166,25 @@ private class GameHeaderBar : BaseHeaderBar, AdaptativeWidget
* * hamburger menu
\*/
+ public GLib.Menu? appearance_menu { private get; protected construct; default = null; }
protected override void populate_menu (ref GLib.Menu menu)
{
- append_sound_section (ref menu);
+ append_options_section (ref menu, appearance_menu);
}
- private static inline void append_sound_section (ref GLib.Menu menu)
+ private static inline void append_options_section (ref GLib.Menu menu, GLib.Menu? appearance_menu)
{
GLib.Menu section = new GLib.Menu ();
+
+ // if (appearance_menu != null)
+ /* Translators: hamburger menu entry; "Appearance" submenu (with a mnemonic that appears
pressing Alt) */
+ // section.append_submenu (_("A_ppearance"), (!) appearance_menu);
+
+
+
/* Translators: hamburger menu entry; sound togglebutton (with a mnemonic that appears pressing Alt)
*/
section.append (_("_Sound"), "app.sound");
+
section.freeze ();
menu.append_section (null, section);
}
diff --git a/src/game-window.vala b/src/game-window.vala
index b75168d..8b9b997 100644
--- a/src/game-window.vala
+++ b/src/game-window.vala
@@ -39,9 +39,9 @@ private class GameWindow : BaseWindow, AdaptativeWidget
private GameView game_view;
private Box new_game_screen;
- internal GameWindow (string? css_resource, string name, string about_action_label, bool start_now,
GameWindowFlags flags, Box _new_game_screen, Widget view_content, NightLightMonitor night_light_monitor)
+ internal GameWindow (string? css_resource, string name, string about_action_label, bool start_now,
GameWindowFlags flags, Box _new_game_screen, Widget view_content, GLib.Menu? appearance_menu,
NightLightMonitor night_light_monitor)
{
- GameHeaderBar _headerbar = new GameHeaderBar (name, about_action_label, flags, night_light_monitor);
+ GameHeaderBar _headerbar = new GameHeaderBar (name, about_action_label, flags, appearance_menu,
night_light_monitor);
GameView _game_view = new GameView (flags, _new_game_screen, view_content);
Object (nta_headerbar : (NightTimeAwareHeaderBar) _headerbar,
@@ -85,7 +85,7 @@ private class GameWindow : BaseWindow, AdaptativeWidget
}
/*\
- * * Some public calls
+ * * some public calls
\*/
internal void move_done (uint moves_count)
@@ -126,7 +126,7 @@ private class GameWindow : BaseWindow, AdaptativeWidget
}
/*\
- * * Showing the Stack
+ * * showing the stack
\*/
private void show_new_game_screen ()
@@ -158,6 +158,7 @@ private class GameWindow : BaseWindow, AdaptativeWidget
private SimpleAction restart_action;
private SimpleAction undo_action;
private SimpleAction redo_action;
+ // private SimpleAction hint_action;
private bool back_action_disabled = true;
@@ -170,6 +171,7 @@ private class GameWindow : BaseWindow, AdaptativeWidget
restart_action = (SimpleAction) action_group.lookup_action ("restart");
undo_action = (SimpleAction) action_group.lookup_action ("undo");
redo_action = (SimpleAction) action_group.lookup_action ("redo");
+ // hint_action = (SimpleAction) action_group.lookup_action ("hint");
restart_action.set_enabled (false);
undo_action.set_enabled (false);
@@ -229,7 +231,6 @@ private class GameWindow : BaseWindow, AdaptativeWidget
return;
game_finished = false;
- hide_notification ();
game_view.show_game_content (/* grab focus */ true);
redo_action.set_enabled (true);
diff --git a/src/taquin-main.vala b/src/taquin-main.vala
index 494dea1..d213ce1 100644
--- a/src/taquin-main.vala
+++ b/src/taquin-main.vala
@@ -158,6 +158,7 @@ private class Taquin : Gtk.Application, BaseApplication
| GameWindowFlags.SHOW_UNDO,
(Box) new_game_screen,
view,
+ null, // appearance menu
night_light_monitor);
window.play.connect (start_game);
window.undo.connect (undo_cb);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]