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




commit f7875eedb2de3387862486d8c9661a2d09a31c1b
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 3c17cac..b07662b 100644
--- a/src/sudoku-view.vala
+++ b/src/sudoku-view.vala
@@ -473,16 +473,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, 1.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 = -1;
     private int selected_col = -1;
@@ -503,12 +504,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.visible = false;


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