[gnome-sudoku/arnaudb/wip/gtk4: 6/25] Widgets are visible.



commit 6c9676400200e09b9c22bde1cbc1bec77848db42
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sun Apr 12 14:25:56 2020 +0200

    Widgets are visible.
    
    TODO check the revealer.

 src/gnome-sudoku.vala  | 11 +++++------
 src/number-picker.vala |  5 -----
 src/print-dialog.vala  |  3 +--
 src/sudoku-view.vala   |  3 ---
 4 files changed, 6 insertions(+), 16 deletions(-)
---
diff --git a/src/gnome-sudoku.vala b/src/gnome-sudoku.vala
index 896a6a4..32b60e5 100644
--- a/src/gnome-sudoku.vala
+++ b/src/gnome-sudoku.vala
@@ -315,7 +315,7 @@ public class Sudoku : Gtk.Application
                 dialog.destroy ();
             });
 
-            dialog.show ();
+            dialog.present ();
         }
     }
 
@@ -387,7 +387,6 @@ public class Sudoku : Gtk.Application
             view.show_warnings = settings.get_boolean ("show-warnings");
         view.highlighter = settings.get_boolean ("highlighter");
 
-        view.show ();
         game_box.pack_start (view);
 
         game.cell_changed.connect (() => {
@@ -428,7 +427,7 @@ public class Sudoku : Gtk.Application
                 dialog.destroy ();
             });
 
-            dialog.show ();
+            dialog.present ();
         });
     }
 
@@ -506,7 +505,7 @@ public class Sudoku : Gtk.Application
             dialog.destroy ();
         });
 
-        dialog.show ();
+        dialog.present ();
     }
 
     private void show_game_view ()
@@ -524,14 +523,14 @@ public class Sudoku : Gtk.Application
         if (current_game_mode == GameMode.PLAY)
         {
             play_custom_game_button.visible = false;
-            play_pause_button.visible = true;
+            play_pause_button.show ();
         }
         else
         {
             clock_label.hide ();
             clock_image.hide ();
             play_custom_game_button.visible = true;
-            play_pause_button.visible = false;
+            play_pause_button.hide ();
         }
     }
 
diff --git a/src/number-picker.vala b/src/number-picker.vala
index 5a2209d..798f300 100644
--- a/src/number-picker.vala
+++ b/src/number-picker.vala
@@ -55,7 +55,6 @@ private class NumberPicker : Grid
                 label.margin_top    = earmark ?  0 : 4;
                 label.margin_bottom = earmark ?  8 : 4;
                 button.add (label);
-                label.show ();
 
                 if (!earmark)
                     button.clicked.connect (() => {
@@ -77,8 +76,6 @@ private class NumberPicker : Grid
 
                 if (n == 5)
                     button.grab_focus ();
-
-                button.show ();
             }
         }
 
@@ -91,7 +88,6 @@ private class NumberPicker : Grid
             var label = new Label ("<big>%s</big>".printf (_("Clear")));
             label.use_markup = true;
             clear_button.add (label);
-            label.show ();
 
             clear_button.clicked.connect (() => {
                 number_picked (0);
@@ -106,7 +102,6 @@ private class NumberPicker : Grid
         this.margin_bottom = 2;
         this.row_spacing    = 3;
         this.column_spacing = 3;
-        this.show ();
     }
 
     public void set_clear_button_visibility (bool visible)
diff --git a/src/print-dialog.vala b/src/print-dialog.vala
index 79956d3..4766b4d 100644
--- a/src/print-dialog.vala
+++ b/src/print-dialog.vala
@@ -86,7 +86,6 @@ public class PrintDialog : Dialog
     public bool start_spinner_cb ()
     {
         revealer.set_transition_type (RevealerTransitionType.SLIDE_LEFT);
-        revealer.show_all ();
         spinner.start ();
         revealer.set_reveal_child (true);
         return Source.REMOVE;
@@ -128,7 +127,7 @@ public class PrintDialog : Dialog
                 var boards = SudokuGenerator.generate_boards_async.end (res);
 
                 spinner.stop ();
-                revealer.hide ();
+                revealer.hide ();   // TODO check if hide is the good thing
 
                 var printer = new SudokuPrinter (boards, this);
                 if (printer.print_sudoku () == PrintOperationResult.APPLY)
diff --git a/src/sudoku-view.vala b/src/sudoku-view.vala
index 67cba51..0070605 100644
--- a/src/sudoku-view.vala
+++ b/src/sudoku-view.vala
@@ -573,9 +573,6 @@ public class SudokuView : AspectFrame
 
         overlay.add (drawing);
         overlay.add_overlay (grid);
-        drawing.show ();
-        grid.show_all ();
-        overlay.show ();
     }
 
     private bool draw_board (Cairo.Context c)


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