[gnome-sudoku/arnaudb/wip/gtk4: 22/47] Widgets are visible.




commit a5abba2be127ad2e92962cb00b6a6351c5041b42
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   |  4 +---
 4 files changed, 7 insertions(+), 16 deletions(-)
---
diff --git a/src/gnome-sudoku.vala b/src/gnome-sudoku.vala
index 3c77e58..bd18e26 100644
--- a/src/gnome-sudoku.vala
+++ b/src/gnome-sudoku.vala
@@ -318,7 +318,7 @@ public class Sudoku : Gtk.Application
                 dialog.destroy ();
             });
 
-            dialog.show ();
+            dialog.present ();
         }
     }
 
@@ -390,7 +390,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 (() => {
@@ -431,7 +430,7 @@ public class Sudoku : Gtk.Application
                 dialog.destroy ();
             });
 
-            dialog.show ();
+            dialog.present ();
         });
     }
 
@@ -509,7 +508,7 @@ public class Sudoku : Gtk.Application
             dialog.destroy ();
         });
 
-        dialog.show ();
+        dialog.present ();
     }
 
     private void show_game_view ()
@@ -527,14 +526,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 1a696fe..5e521a8 100644
--- a/src/print-dialog.vala
+++ b/src/print-dialog.vala
@@ -106,7 +106,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;
@@ -149,7 +148,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, nsudokus_per_page, this);
                 if (printer.print_sudoku () == PrintOperationResult.APPLY)
diff --git a/src/sudoku-view.vala b/src/sudoku-view.vala
index 2a043c2..cee3455 100644
--- a/src/sudoku-view.vala
+++ b/src/sudoku-view.vala
@@ -513,6 +513,7 @@ public class SudokuView : AspectFrame
         add (overlay);
 
         drawing = new DrawingArea ();
+        drawing.visible = false;
         drawing.draw.connect (draw_board);
 
         if (grid != null)
@@ -601,9 +602,6 @@ public class SudokuView : AspectFrame
 
         overlay.add_overlay (drawing);
         overlay.add (grid);
-        grid.show_all ();
-        overlay.show ();
-        drawing.hide ();
     }
 
     private void update_highlights ()


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