[gnome-sudoku/arnaudb/wip/gtk4: 12/33] Widgets are visible.



commit dfd30081b7c1fa05514b4dd012013496ca23cd0c
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 b503d49..e98c77b 100644
--- a/src/number-picker.vala
+++ b/src/number-picker.vala
@@ -54,7 +54,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 (() => {
@@ -71,8 +70,6 @@ private class NumberPicker : Grid
 
                 if (n == 5)
                     button.grab_focus ();
-
-                button.show ();
             }
         }
 
@@ -85,7 +82,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);
@@ -100,7 +96,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 f5c0b03..f3e6a4e 100644
--- a/src/sudoku-view.vala
+++ b/src/sudoku-view.vala
@@ -600,9 +600,6 @@ public class SudokuView : AspectFrame
 
         overlay.add_overlay (drawing);
         overlay.add (grid);
-        grid.show_all ();
-        overlay.show ();
-        drawing.hide ();
     }
 
     private bool draw_board (Cairo.Context c)


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