[gnome-mines/arnaudb/gaction: 1/2] Use GAction more.




commit a0186aec450d6406588a1d0fd1c2bd2a10958fc7
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Wed Sep 9 17:53:50 2020 +0200

    Use GAction more.

 src/gnome-mines.vala |  8 --------
 src/interface.ui     | 24 ++++++++++--------------
 2 files changed, 10 insertions(+), 22 deletions(-)
---
diff --git a/src/gnome-mines.vala b/src/gnome-mines.vala
index 00bb314..0dc8d9f 100644
--- a/src/gnome-mines.vala
+++ b/src/gnome-mines.vala
@@ -380,32 +380,24 @@ public class Mines : Gtk.Application
         new_game_screen =  (AspectFrame) builder.get_object ("new_game_screen");
 
         var button = (Button) builder.get_object ("small_size_btn");
-        button.clicked.connect (small_size_clicked_cb);
-
         var label = new Label (null);
         label.set_markup (make_minefield_description (8, 8, 10));
         label.set_justify (Justification.CENTER);
         button.add (label);
 
         button = (Button) builder.get_object ("medium_size_btn");
-        button.clicked.connect (medium_size_clicked_cb);
-
         label = new Label (null);
         label.set_markup (make_minefield_description (16, 16, 40));
         label.set_justify (Justification.CENTER);
         button.add (label);
 
         button = (Button) builder.get_object ("large_size_btn");
-        button.clicked.connect (large_size_clicked_cb);
-
         label = new Label (null);
         label.set_markup (make_minefield_description (30, 16, 99));
         label.set_justify (Justification.CENTER);
         button.add (label);
 
         button = (Button) builder.get_object ("custom_size_btn");
-        button.clicked.connect (show_custom_game_screen);
-
         label = new Label (null);
         label.set_markup_with_mnemonic ("<span size='xx-large' weight='heavy'>?</span>\n" + dpgettext2 
(null, "board size", _("Custom")));
         label.set_justify (Justification.CENTER);
diff --git a/src/interface.ui b/src/interface.ui
index c511a55..f2708e5 100644
--- a/src/interface.ui
+++ b/src/interface.ui
@@ -48,8 +48,7 @@
                     <child>
                       <object class="GtkButton" id="small_size_btn">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
+                        <property name="action-name">app.small-size</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -57,32 +56,29 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkButton" id="large_size_btn">
+                      <object class="GtkButton" id="medium_size_btn">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
+                        <property name="action-name">app.medium-size</property>
                       </object>
                       <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">1</property>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">0</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkButton" id="medium_size_btn">
+                      <object class="GtkButton" id="large_size_btn">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
+                        <property name="action-name">app.large-size</property>
                       </object>
                       <packing>
-                        <property name="left_attach">1</property>
-                        <property name="top_attach">0</property>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">1</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkButton" id="custom_size_btn">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
+                        <property name="action-name">app.custom-size</property>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]