[gnome-nibbles/arnaudb/wip/gtk4: 14/40] Replace GamesGridFrame by GtkAspectFrame.



commit 552e3b6d8779c6dac539dd1a762bd4510d222000
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sat May 30 18:50:17 2020 +0200

    Replace GamesGridFrame by GtkAspectFrame.

 src/nibbles-window.vala | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/nibbles-window.vala b/src/nibbles-window.vala
index cc6042d..08490c5 100644
--- a/src/nibbles-window.vala
+++ b/src/nibbles-window.vala
@@ -55,7 +55,7 @@ private class NibblesWindow : ApplicationWindow
     private NibblesView? view;
 
     [GtkChild] private Box game_box;
-    private Games.GridFrame frame;
+    private AspectFrame frame;
 
     /* Game being played */
     private NibblesGame? game = null;
@@ -134,13 +134,13 @@ private class NibblesWindow : ApplicationWindow
                                 settings.get_int ("tile-size"),
                                 !settings.get_boolean ("sound"));
 
-        frame = new Games.GridFrame (NibblesGame.WIDTH, NibblesGame.HEIGHT);
+        frame = new AspectFrame (/* x align */ 0.5f, /* y align */ 0.5f, /* ratio ignored */ 0.0f, /* obey 
child */ true);
         game_box.pack_start (frame);
 
         /* Create scoreboard */
         scoreboard_life = NibblesView.load_pixmap_file ("scoreboard-life.svg", 2 * view.tile_size, 2 * 
view.tile_size);
 
-        frame.add (view);
+        frame.set_child (view);
 
         /* Number of worms */
         game.numhumans = settings.get_int ("players");


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