[gnome-sudoku/arnaudb/wip/gtk4: 22/25] Make popovers work.



commit b33d5737bc54cd570cda17a5b7fd0183125a8f28
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 da63a64..e0fefaf 100644
--- a/src/sudoku-view.vala
+++ b/src/sudoku-view.vala
@@ -108,6 +108,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;
@@ -203,6 +209,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);
@@ -226,6 +233,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);


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