[gnome-sudoku/arnaudb/wip/gtk4: 27/33] Make popovers work.



commit 8a40fe0a6651e9e3e6d39678b24fd92a4186adfc
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Fri Apr 17 22:05:30 2020 +0200

    Make popovers work.

 src/sudoku-view.vala | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/sudoku-view.vala b/src/sudoku-view.vala
index 4853209..596a8b2 100644
--- a/src/sudoku-view.vala
+++ b/src/sudoku-view.vala
@@ -95,6 +95,12 @@ private class SudokuCellView : DrawingArea
     private EventControllerKey key_controller;      // for keeping in memory
     private GestureClick click_controller;          // for keeping in memory
 
+    construct
+    {
+        BinLayout layout = new BinLayout ();
+        set_layout_manager (layout);
+    }
+
     public SudokuCellView (int row, int col, ref SudokuGame game)
     {
         this.game = game;
@@ -189,6 +195,7 @@ private class SudokuCellView : DrawingArea
         popover.add (number_picker);
         popover.set_autohide (false);
         popover.position = PositionType.BOTTOM;
+        popover.set_parent (this);
         popover.notify["visible"].connect (()=> {
             if (!popover.visible)
                 destroy_popover (ref popover, ref number_picker);
@@ -212,6 +219,7 @@ private class SudokuCellView : DrawingArea
         earmark_popover.add (earmark_picker);
         earmark_popover.set_autohide (false);
         earmark_popover.position = PositionType.BOTTOM;
+        earmark_popover.set_parent (this);
         earmark_popover.notify["visible"].connect (()=> {
             if (!earmark_popover.visible)
                 destroy_popover (ref earmark_popover, ref earmark_picker);


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