[gnome-sudoku/arnaudb/wip/gtk4: 46/47] GtkListBoxRow is not subclassable anymore.




commit d7fa790366405e3c8ddd93753c357ec75b54a80c
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Wed Sep 23 17:39:53 2020 +0200

    GtkListBoxRow is not subclassable anymore.

 data/gnome-sudoku.ui  | 60 ++++++++++++++++++++++++++++++++++++++++-----------
 src/gnome-sudoku.vala |  3 ---
 src/main-menu.vala    | 59 --------------------------------------------------
 src/meson.build       |  1 -
 4 files changed, 48 insertions(+), 75 deletions(-)
---
diff --git a/data/gnome-sudoku.ui b/data/gnome-sudoku.ui
index cc4d2ec..970488b 100644
--- a/data/gnome-sudoku.ui
+++ b/data/gnome-sudoku.ui
@@ -183,40 +183,76 @@
                     <property name="visible">True</property>
                     <property name="shadow-type">GTK_SHADOW_IN</property>
                     <child>
-                      <object class="SudokuMainMenu">
+                      <object class="GtkListBox">
+                        <property name="show-separators">True</property>
+                        <property name="can-focus">False</property>
                         <child>
-                          <object class="SudokuMainMenuItem">
-                            <property name="label" translatable="yes">_Easy</property>
+                          <object class="GtkListBoxRow">
                             <property name="action-name">app.start-game</property>
                             <property name="action-target">1</property>  <!-- 1 corresponds to enum 
DifficultyCategory.EASY -->
+                            <property name="height-request">80</property>
+                            <property name="can-focus">True</property>
+                            <property name="child">
+                              <object class="GtkLabel">
+                                <property name="label" translatable="yes">_Easy</property>
+                                <property name="use-underline">True</property>
+                              </object>
+                            </property>
                           </object>
                         </child>
                         <child>
-                          <object class="SudokuMainMenuItem">
-                            <property name="label" translatable="yes">_Medium</property>
+                          <object class="GtkListBoxRow">
                             <property name="action-name">app.start-game</property>
                             <property name="action-target">2</property>  <!-- 2 corresponds to enum 
DifficultyCategory.MEDIUM -->
+                            <property name="height-request">80</property>
+                            <property name="can-focus">True</property>
+                            <property name="child">
+                              <object class="GtkLabel">
+                                <property name="label" translatable="yes">_Medium</property>
+                                <property name="use-underline">True</property>
+                              </object>
+                            </property>
                           </object>
                         </child>
                         <child>
-                          <object class="SudokuMainMenuItem">
-                            <property name="label" translatable="yes">_Hard</property>
+                          <object class="GtkListBoxRow">
                             <property name="action-name">app.start-game</property>
                             <property name="action-target">3</property>  <!-- 3 corresponds to enum 
DifficultyCategory.HARD -->
+                            <property name="height-request">80</property>
+                            <property name="can-focus">True</property>
+                            <property name="child">
+                              <object class="GtkLabel">
+                                <property name="label" translatable="yes">_Hard</property>
+                                <property name="use-underline">True</property>
+                              </object>
+                            </property>
                           </object>
                         </child>
                         <child>
-                          <object class="SudokuMainMenuItem">
-                            <property name="label" translatable="yes">_Very Hard</property>
+                          <object class="GtkListBoxRow">
                             <property name="action-name">app.start-game</property>
                             <property name="action-target">4</property>  <!-- 4 corresponds to enum 
DifficultyCategory.VERY_HARD -->
+                            <property name="height-request">80</property>
+                            <property name="can-focus">True</property>
+                            <property name="child">
+                              <object class="GtkLabel">
+                                <property name="label" translatable="yes">_Very Hard</property>
+                                <property name="use-underline">True</property>
+                              </object>
+                            </property>
                           </object>
                         </child>
                         <child>
-                          <object class="SudokuMainMenuItem">
-                            <property name="label" translatable="yes">_Create your own puzzle</property>
+                          <object class="GtkListBoxRow">
                             <property name="action-name">app.create-game</property>
-                            <property name="has-separator">True</property>
+                            <property name="height-request">80</property>
+                            <property name="can-focus">True</property>
+                            <property name="child">
+                              <object class="GtkLabel">
+                                <property name="label" translatable="yes">_Create your own puzzle</property>
+                                <property name="use-underline">True</property>
+                              </object>
+                            </property>
                           </object>
                         </child>
                       </object>
diff --git a/src/gnome-sudoku.vala b/src/gnome-sudoku.vala
index ab4b87d..36cb8c7 100644
--- a/src/gnome-sudoku.vala
+++ b/src/gnome-sudoku.vala
@@ -101,9 +101,6 @@ public class Sudoku : Gtk.Application
 
         Object (application_id: "org.gnome.Sudoku", flags: ApplicationFlags.FLAGS_NONE);
         add_main_option_entries (option_entries);
-
-        typeof (SudokuMainMenu).ensure ();
-        typeof (SudokuMainMenuItem).ensure ();
     }
 
     protected override int handle_local_options (GLib.VariantDict options)
diff --git a/src/meson.build b/src/meson.build
index af37b80..64faa21 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -6,7 +6,6 @@ gnome_sudoku_vala_args = [
 gnome_sudoku_sources = [
   'config.vapi',
   'gnome-sudoku.vala',
-  'main-menu.vala',
   'number-picker.vala',
   'print-dialog.vala',
   'sudoku-printer.vala',


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