[gnome-nibbles/arnaudb/wip/gtk4: 152/188] Adapt to GtkBox API.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-nibbles/arnaudb/wip/gtk4: 152/188] Adapt to GtkBox API.
- Date: Fri, 2 Oct 2020 15:55:21 +0000 (UTC)
commit 88cf1a2bf04beb8ae19df2ad4945900c32f8ba68
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Sat May 30 18:55:50 2020 +0200
Adapt to GtkBox API.
src/controls.vala | 7 ++++---
src/nibbles-window.vala | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/controls.vala b/src/controls.vala
index 4f07358..aa9af2c 100644
--- a/src/controls.vala
+++ b/src/controls.vala
@@ -34,8 +34,9 @@ private class Controls : Box
internal void prepare (Gee.LinkedList<Worm> worms, Gee.HashMap<Worm, WormProperties> worm_props)
{
- foreach (var grid in grids_box.get_children ())
- grid.destroy ();
+ Widget? widget;
+ while ((widget = grids_box.get_first_child ()) != null)
+ widget.destroy ();
GenericSet<uint> duplicate_keys = new GenericSet<uint> (direct_hash, direct_equal);
GenericSet<uint> encountered_keys = new GenericSet<uint> (direct_hash, direct_equal);
@@ -46,7 +47,7 @@ private class Controls : Box
WormProperties worm_prop = worm_props.@get (worm);
var grid = new ControlsGrid (worm.id, worm_prop, arrow_pixbuf);
- grids_box.add (grid);
+ grids_box.prepend (grid);
grids.add (grid);
check_for_duplicates (worm_prop.up, ref encountered_keys, ref duplicate_keys);
diff --git a/src/nibbles-window.vala b/src/nibbles-window.vala
index f496ff4..f1f6243 100644
--- a/src/nibbles-window.vala
+++ b/src/nibbles-window.vala
@@ -156,7 +156,7 @@ private class NibblesWindow : ApplicationWindow
!settings.get_boolean ("sound"));
frame = new AspectFrame (/* x align */ 0.5f, /* y align */ 0.5f, /* ratio ignored */ 0.0f, /* obey
child */ true);
- game_box.pack_start (frame);
+ frame.insert_after (game_box, /* insert first */ null);
/* Create scoreboard */
scoreboard_life = NibblesView.load_pixmap_file ("scoreboard-life.svg", 2 * view.tile_size, 2 *
view.tile_size);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]