diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 76ef18d0d..f6075095e 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -218,14 +218,6 @@ public class AppCenter.MainWindow : Hdy.ApplicationWindow { description = _("System updates and unpaid apps will not update automatically") }; - automatic_updates_button.notify["active"].connect (() => { - if (automatic_updates_button.active) { - AppCenterCore.Client.get_default ().update_cache.begin (true); - } else { - AppCenterCore.Client.get_default ().cancel_updates (true); - } - }); - var refresh_accellabel = new Granite.AccelLabel.from_action_name ( _("Check for Updates"), "app.refresh" @@ -237,24 +229,18 @@ public class AppCenter.MainWindow : Hdy.ApplicationWindow { refresh_menuitem.get_child ().destroy (); refresh_menuitem.add (refresh_accellabel); - var menu_popover_grid = new Gtk.Grid () { - column_spacing = 6, + var menu_popover_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0) { margin_bottom = 6, - margin_top = 6, - orientation = Gtk.Orientation.VERTICAL, - row_spacing = 6 + margin_top = 6 }; - - menu_popover_grid.add (automatic_updates_button); - menu_popover_grid.add (refresh_menuitem); - - menu_popover_grid.show_all (); + menu_popover_box.add (automatic_updates_button); + menu_popover_box.add (refresh_menuitem); + menu_popover_box.show_all (); var menu_popover = new Gtk.Popover (null); - menu_popover.add (menu_popover_grid); + menu_popover.add (menu_popover_box); var menu_button = new Gtk.MenuButton () { - can_focus = false, image = new Gtk.Image.from_icon_name ("open-menu", Gtk.IconSize.LARGE_TOOLBAR), popover = menu_popover, tooltip_text = _("Settings"), @@ -319,6 +305,14 @@ public class AppCenter.MainWindow : Hdy.ApplicationWindow { stack.notify["visible-child"].connect (on_view_mode_changed); + automatic_updates_button.notify["active"].connect (() => { + if (automatic_updates_button.active) { + AppCenterCore.Client.get_default ().update_cache.begin (true, AppCenterCore.Client.CacheUpdateType.FLATPAK); + } else { + AppCenterCore.Client.get_default ().cancel_updates (true); + } + }); + eventbox_badge.button_release_event.connect (() => { stack.visible_child = installed_view; });