[gnome-sudoku/arnaudb/wip/gtk4: 15/25] AspectFrame is not subclassable anymore.



commit d9198d58fa840ad7c5aa422be104137d5e530904
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sun Apr 12 15:56:56 2020 +0200

    AspectFrame is not subclassable anymore.

 src/sudoku-view.vala | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/src/sudoku-view.vala b/src/sudoku-view.vala
index c419826..30a1f30 100644
--- a/src/sudoku-view.vala
+++ b/src/sudoku-view.vala
@@ -463,16 +463,17 @@ public const RGBA   free_cell_color = { 1.0f,  1.0f,  1.0f,  1.0f };
 public const RGBA   highlight_color = { 0.93f, 0.93f, 0.93f, 0.0f };
 public const RGBA selected_bg_color = { 0.7f,  0.8f,  0.9f,  1.0f };
 
-public class SudokuView : AspectFrame
+public class SudokuView : Widget
 {
     public SudokuGame game;
     private SudokuCellView[,] cells;
 
     private bool previous_board_broken_state = false;
 
-    private Overlay overlay;
+    private AspectFrame frame;
+    private Overlay     overlay;
     private DrawingArea drawing;
-    private Grid grid;
+    private Grid        grid;
 
     private int selected_row = 0;
     private int selected_col = 0;
@@ -487,12 +488,15 @@ public class SudokuView : AspectFrame
 
     public SudokuView (SudokuGame game)
     {
-        shadow_type = ShadowType.NONE;
-        obey_child = false;
-        ratio = 1;
+        BinLayout layout = new BinLayout ();
+        set_layout_manager (layout);
+
+        frame = new AspectFrame (/* no title */ null, /* xalign */ 0.5f, /* yalign */ 0.5f, /* ratio */ 
1.0f, /* obey child */ false);
+        frame.shadow_type = ShadowType.NONE;
+        frame.insert_after (this, /* insert first */ null);
 
         overlay = new Overlay ();
-        add (overlay);
+        frame.add (overlay);
 
         drawing = new DrawingArea ();
         drawing.set_draw_func (draw_board);


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