[gnome-mahjongg/arnaudb/wip/gtk4: 11/23] Adapt to Box API.



commit f0ec9061b5b874a3fcbddbef6f09925bd3068ce3
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Fri Mar 27 19:03:15 2020 +0100

    Adapt to Box API.

 src/gnome-mahjongg.vala | 22 +++++++++++-----------
 src/score-dialog.vala   | 10 +++++-----
 2 files changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/src/gnome-mahjongg.vala b/src/gnome-mahjongg.vala
index d0cb733..bc8937d 100644
--- a/src/gnome-mahjongg.vala
+++ b/src/gnome-mahjongg.vala
@@ -88,15 +88,15 @@ public class Mahjongg : Gtk.Application
 
         var group_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
         var label = new Gtk.Label (_("Moves Left:"));
-        group_box.pack_start (label, false, false, 0);
+        group_box.add (label);
         var spacer = new Gtk.Label (" ");
-        group_box.pack_start (spacer, false, false, 0);
+        group_box.add (spacer);
         moves_label = new Gtk.Label ("");
-        group_box.pack_start (moves_label, false, false, 0);
-        status_box.pack_start (group_box, false, false, 0);
+        group_box.add (moves_label);
+        status_box.add (group_box);
 
         clock_label = new Gtk.Label ("");
-        status_box.pack_start (clock_label, false, false, 0);
+        status_box.add (clock_label);
 
         var vbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
 
@@ -116,13 +116,13 @@ public class Mahjongg : Gtk.Application
         undo_button.valign = Gtk.Align.CENTER;
         undo_button.action_name = "app.undo";
         undo_button.set_tooltip_text (_("Undo your last move"));
-        hbox.pack_start (undo_button);
+        hbox.add (undo_button);
 
         var redo_button = new Gtk.Button.from_icon_name ("edit-redo-symbolic", Gtk.IconSize.BUTTON);
         redo_button.valign = Gtk.Align.CENTER;
         redo_button.action_name = "app.redo";
         redo_button.set_tooltip_text (_("Redo your last move"));
-        hbox.pack_start (redo_button);
+        hbox.add (redo_button);
 
         var hint_button = new Gtk.Button.from_icon_name ("dialog-question-symbolic", Gtk.IconSize.BUTTON);
         hint_button.valign = Gtk.Align.CENTER;
@@ -135,9 +135,9 @@ public class Mahjongg : Gtk.Application
         pause_button.set_tooltip_text (_("Pause the game"));
 
         var title_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 2);
-        title_box.pack_start (title, false, false, 0);
+        title_box.add (title);
         status_box.halign = Gtk.Align.CENTER;
-        title_box.pack_start (status_box, false, false, 0);
+        title_box.add (status_box);
 
         var menu = new Menu ();
         var mahjongg_menu = new Menu ();
@@ -166,7 +166,7 @@ public class Mahjongg : Gtk.Application
         header_bar.pack_end (pause_button);
         window.set_titlebar (header_bar);
 
-        vbox.pack_start (game_view, true, true, 0);
+        vbox.add (game_view);
 
         window.add (vbox);
         window.show_all ();
@@ -503,7 +503,7 @@ public class Mahjongg : Gtk.Application
         grid.attach (widget, 1, 2, 1, 1);
         label.set_mnemonic_widget (widget);
 
-        dialog_content_area.pack_start (grid, true, true, 0);
+        dialog_content_area.add (grid);
 
         if (!dialogs_use_header)
             preferences_dialog.add_button (_("_Close"), Gtk.ResponseType.CLOSE);
diff --git a/src/score-dialog.vala b/src/score-dialog.vala
index 82662cf..b1d8269 100644
--- a/src/score-dialog.vala
+++ b/src/score-dialog.vala
@@ -35,15 +35,15 @@ public class ScoreDialog : Gtk.Dialog
         var vbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 5);
         vbox.border_width = 6;
         vbox.show ();
-        get_content_area ().pack_start (vbox, true, true, 0);
+        get_content_area ().add (vbox);
 
         var hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
         hbox.show ();
-        vbox.pack_start (hbox, false, false, 0);
+        vbox.add (hbox);
 
         var label = new Gtk.Label (_("Layout:"));
         label.show ();
-        hbox.pack_start (label, false, false, 0);
+        hbox.add (label);
 
         size_model = new Gtk.ListStore (2, typeof (string), typeof (string));
 
@@ -54,13 +54,13 @@ public class ScoreDialog : Gtk.Dialog
         size_combo.pack_start (renderer, true);
         size_combo.add_attribute (renderer, "text", 0);
         size_combo.show ();
-        hbox.pack_start (size_combo, true, true, 0);
+        hbox.add (size_combo);
 
         var scroll = new Gtk.ScrolledWindow (null, null);
         scroll.shadow_type = Gtk.ShadowType.ETCHED_IN;
         scroll.set_policy (Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
         scroll.show ();
-        vbox.pack_start (scroll, true, true, 0);
+        vbox.add (scroll);
 
         score_model = new Gtk.ListStore (3, typeof (string), typeof (string), typeof (int));
 


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