[gnome-games] display-header-bar: Hide menu automatically on null runner



commit ac6f9de947122b7bc3450c9227b8c27563e6dbca
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Jan 28 19:10:04 2020 +0500

    display-header-bar: Hide menu automatically on null runner

 src/ui/display-header-bar.vala | 11 +++--------
 src/ui/display-view.vala       |  2 --
 2 files changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/src/ui/display-header-bar.vala b/src/ui/display-header-bar.vala
index b190b480..29ff166c 100644
--- a/src/ui/display-header-bar.vala
+++ b/src/ui/display-header-bar.vala
@@ -35,11 +35,10 @@ private class Games.DisplayHeaderBar : Gtk.Bin {
                        _runner = value;
                        input_mode_switcher.runner = value;
 
-                       if (runner != null) {
-                               extra_widget = runner.get_extra_widget ();
+                       secondary_menu_button.visible = runner != null && runner.is_integrated;
 
-                               secondary_menu_button.visible = runner.is_integrated;
-                       }
+                       if (runner != null)
+                               extra_widget = runner.get_extra_widget ();
                        else
                                extra_widget = null;
                }
@@ -81,10 +80,6 @@ private class Games.DisplayHeaderBar : Gtk.Bin {
                settings = new Settings ("org.gnome.Games");
        }
 
-       public void hide_secondary_menu_button () {
-               secondary_menu_button.visible = false;
-       }
-
        [GtkCallback]
        private void on_fullscreen_changed () {
                fullscreen.visible = can_fullscreen && !is_fullscreen;
diff --git a/src/ui/display-view.vala b/src/ui/display-view.vala
index 50d61aae..0f29f63e 100644
--- a/src/ui/display-view.vala
+++ b/src/ui/display-view.vala
@@ -490,8 +490,6 @@ private class Games.DisplayView : Object, UiView {
        }
 
        private void reset_display_page () {
-               header_bar.hide_secondary_menu_button ();
-
                header_bar.can_fullscreen = false;
                box.header_bar.can_fullscreen = false;
                header_bar.runner = null;


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