[gnome-mahjongg/arnaudb/wip/gtk4: 25/41] Adapt to Box API.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-mahjongg/arnaudb/wip/gtk4: 25/41] Adapt to Box API.
- Date: Wed, 23 Sep 2020 14:23:03 +0000 (UTC)
commit 484a22423cd8ae6edfcbc29c6de76c96b9e38f24
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Fri Mar 27 19:03:15 2020 +0100
Adapt to Box API.
src/gnome-mahjongg.vala | 24 ++++++++++++------------
src/score-dialog.vala | 10 +++++-----
2 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/src/gnome-mahjongg.vala b/src/gnome-mahjongg.vala
index 40d2344..f0b2ab1 100644
--- a/src/gnome-mahjongg.vala
+++ b/src/gnome-mahjongg.vala
@@ -90,15 +90,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.append (label);
var spacer = new Gtk.Label (" ");
- group_box.pack_start (spacer, false, false, 0);
+ group_box.append (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.append (moves_label);
+ status_box.append (group_box);
clock_label = new Gtk.Label ("");
- status_box.pack_start (clock_label, false, false, 0);
+ status_box.append (clock_label);
var vbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
@@ -118,13 +118,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.append (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.append (redo_button);
var hint_button = new Gtk.Button.from_icon_name ("dialog-question-symbolic", Gtk.IconSize.BUTTON);
hint_button.valign = Gtk.Align.CENTER;
@@ -137,9 +137,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.append (title);
status_box.halign = Gtk.Align.CENTER;
- title_box.pack_start (status_box, false, false, 0);
+ title_box.append (status_box);
var menu = new Menu ();
var mahjongg_menu = new Menu ();
@@ -168,9 +168,9 @@ 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.append (game_view);
- window.add (vbox);
+ window.set_child (vbox);
window.show_all ();
settings.changed.connect (conf_value_changed_cb);
@@ -505,7 +505,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.append (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 65bcaf0..5d0cb6f 100644
--- a/src/score-dialog.vala
+++ b/src/score-dialog.vala
@@ -37,15 +37,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 ().append (vbox);
var hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
hbox.show ();
- vbox.pack_start (hbox, false, false, 0);
+ vbox.append (hbox);
var label = new Gtk.Label (_("Layout:"));
label.show ();
- hbox.pack_start (label, false, false, 0);
+ hbox.append (label);
size_model = new Gtk.ListStore (2, typeof (string), typeof (string));
@@ -56,13 +56,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.append (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.append (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]