[gnome-mines/arnaudb/wip/gtk4: 17/40] Widgets are visible.




commit 6ce9418468b1db9ba563622bb190d7d6c4e2f09c
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Mon Apr 13 23:35:39 2020 +0200

    Widgets are visible.

 src/gnome-mines.vala           | 14 +-------------
 src/minefield-view.vala        |  1 -
 src/theme-selector-dialog.vala |  2 --
 3 files changed, 1 insertion(+), 16 deletions(-)
---
diff --git a/src/gnome-mines.vala b/src/gnome-mines.vala
index 51d63f8..ca684f0 100644
--- a/src/gnome-mines.vala
+++ b/src/gnome-mines.vala
@@ -222,7 +222,6 @@ public class Mines : Gtk.Application
         var headerbar = new HeaderBar ();
         headerbar.show_title_buttons = true;
         headerbar.set_title (_("Mines"));
-        headerbar.show ();
         window.set_titlebar (headerbar);
 
         var menu = new GLib.Menu ();
@@ -240,7 +239,6 @@ public class Mines : Gtk.Application
         section.append (_("_About Mines"), "app.about");
         menu_button = new MenuButton ();
         menu_button.set_image (new Image.from_icon_name ("open-menu-symbolic", IconSize.BUTTON));
-        menu_button.show ();
         menu_button.set_menu_model (menu);
         headerbar.pack_end (menu_button);
 
@@ -257,7 +255,6 @@ public class Mines : Gtk.Application
         set_accels_for_action ("app.menu", {"F10"});
 
         minefield_view = new MinefieldView (settings);
-        minefield_view.show ();
 
         /* Hook a resize on the first minefield draw so that the ratio
            calculation in minefield_aspect.size-allocate runs one more time
@@ -276,13 +273,9 @@ public class Mines : Gtk.Application
 
         scrolled = (ScrolledWindow) ui_builder.get_object ("scrolled");
         scrolled.add (minefield_view);
-        scrolled.show ();
 
         minefield_overlay = (Overlay) ui_builder.get_object ("minefield_overlay");
-        minefield_overlay.show ();
-
         minefield_aspect = (AspectFrame) ui_builder.get_object ("minefield_aspect");
-        minefield_aspect.show ();
 
         minefield_aspect.size_allocate.connect ((allocation) => {
              uint width = minefield_view.mine_size * minefield_view.minefield.width;
@@ -306,7 +299,6 @@ public class Mines : Gtk.Application
         minefield_overlay.add_overlay (paused_box);
 
         main_screen = (Widget) ui_builder.get_object ("main_screen");
-        main_screen.show_all ();
 
         /* Initialize New Game Screen */
         startup_new_game_screen (ui_builder);
@@ -413,8 +405,6 @@ public class Mines : Gtk.Application
         label.set_markup_with_mnemonic ("<span size='xx-large' weight='heavy'>?</span>\n" + dpgettext2 
(null, "board size", _("Custom")));
         label.set_justify (Justification.CENTER);
         button.add (label);
-
-        new_game_screen.show_all ();
     }
 
     private void startup_custom_game_screen (Builder builder)
@@ -444,8 +434,6 @@ public class Mines : Gtk.Application
 
         button = (Button) builder.get_object ("play_game_btn");
         button.clicked.connect (custom_size_clicked_cb);
-
-        custom_game_screen.show_all ();
     }
 
     private void size_allocate_cb (Allocation allocation)
@@ -508,7 +496,7 @@ public class Mines : Gtk.Application
 
     public void start ()
     {
-        window.show ();
+        window.present ();
         show_new_game_screen ();
     }
 
diff --git a/src/minefield-view.vala b/src/minefield-view.vala
index 4fc22b3..25a007d 100644
--- a/src/minefield-view.vala
+++ b/src/minefield-view.vala
@@ -190,7 +190,6 @@ public class MinefieldView : Gtk.Grid
                 for (int j = 0; j < _minefield.height; j++)
                 {
                     mines[i,j] = new Tile (i, j);
-                    mines[i,j].show ();
                     mines[i,j].tile_pressed.connect (tile_pressed_cb);
                     mines[i,j].tile_released.connect (tile_released_cb);
                     mines[i,j].tile_long_pressed.connect (tile_long_pressed_cb);
diff --git a/src/theme-selector-dialog.vala b/src/theme-selector-dialog.vala
index af13c61..a59b916 100644
--- a/src/theme-selector-dialog.vala
+++ b/src/theme-selector-dialog.vala
@@ -150,7 +150,6 @@ public class ThemeSelectorDialog : Gtk.Dialog
 
         set_size_request (420, 400);
         update_sensitivities (themes, current_index);
-        show_all ();
     }
 
     private void switch_theme_preview (int to_index, List<string> themes)
@@ -159,7 +158,6 @@ public class ThemeSelectorDialog : Gtk.Dialog
         this.queue_draw ();
         this.get_window ().invalidate_rect (null, true);
         this.present ();
-        //this.show_all ();
     }
 
     private void update_sensitivities (List themes, int current_index)


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