diff --git a/src/Plug.vala b/src/Plug.vala index 2c567644..bc4fdb92 100644 --- a/src/Plug.vala +++ b/src/Plug.vala @@ -65,7 +65,7 @@ public class About.Plug : Switchboard.Plug { var stack_switcher = new Gtk.StackSwitcher () { halign = Gtk.Align.CENTER, - homogeneous = true, + // homogeneous = true, margin_top = 24, stack = stack }; diff --git a/src/Views/FirmwareView.vala b/src/Views/FirmwareView.vala index eb2539a8..d9357261 100644 --- a/src/Views/FirmwareView.vala +++ b/src/Views/FirmwareView.vala @@ -86,7 +86,7 @@ public class About.FirmwareView : Granite.SimpleSettingsPage { if (LoginManager.get_instance ().can_reboot_to_firmware_setup ()) { var reboot_to_firmware_setup_button = new Gtk.Button.with_label (_("Restart to Firmware Setup…")); reboot_to_firmware_setup_button.clicked.connect (reboot_to_firmware_setup_clicked); - action_area.add (reboot_to_firmware_setup_button); + action_area.append (reboot_to_firmware_setup_button); } fwupd_client = new Fwupd.Client (); @@ -226,8 +226,11 @@ public class About.FirmwareView : Granite.SimpleSettingsPage { construct { xalign = 0; - margin = 3; - get_style_context ().add_class (Granite.STYLE_CLASS_H4_LABEL); + margin_top = 3; + margin_end = 3; + margin_bottom = 3; + margin_start = 3; + add_css_class (Granite.STYLE_CLASS_H4_LABEL); } } @@ -333,7 +336,7 @@ public class About.FirmwareView : Granite.SimpleSettingsPage { }; var suggested_button = (Gtk.Button) message_dialog.add_button (_("Continue"), Gtk.ResponseType.ACCEPT); - suggested_button.get_style_context ().add_class (Granite.STYLE_CLASS_SUGGESTED_ACTION); + suggested_button.add_css_class (Granite.STYLE_CLASS_SUGGESTED_ACTION); if (detach_image != null) { var custom_widget = new Gtk.Image.from_file (detach_image); @@ -359,13 +362,16 @@ public class About.FirmwareView : Granite.SimpleSettingsPage { }; var suggested_button = (Gtk.Button) message_dialog.add_button (_("Restart"), Gtk.ResponseType.ACCEPT); - suggested_button.get_style_context ().add_class (Granite.STYLE_CLASS_SUGGESTED_ACTION); + suggested_button.add_css_class (Granite.STYLE_CLASS_SUGGESTED_ACTION); - if (message_dialog.run () == Gtk.ResponseType.ACCEPT) { - LoginManager.get_instance ().reboot (); - } + message_dialog.response.connect ((response) => { + if (response == ACCEPT) { + LoginManager.get_instance ().reboot (); + } + message_dialog.destroy (); + }); - message_dialog.destroy (); + message_dialog.present (); } private void show_shutdown_dialog () { @@ -380,7 +386,7 @@ public class About.FirmwareView : Granite.SimpleSettingsPage { }; var suggested_button = (Gtk.Button) message_dialog.add_button (_("Shut Down"), Gtk.ResponseType.ACCEPT); - suggested_button.get_style_context ().add_class (Granite.STYLE_CLASS_DESTRUCTIVE_ACTION); + suggested_button.add_css_class (Granite.STYLE_CLASS_DESTRUCTIVE_ACTION); if (message_dialog.run () == Gtk.ResponseType.ACCEPT) { LoginManager.get_instance ().shutdown (); @@ -398,11 +404,11 @@ public class About.FirmwareView : Granite.SimpleSettingsPage { ) { badge_icon = new ThemedIcon ("application-x-firmware"), modal = true, - transient_for = (Gtk.Window) get_toplevel () + transient_for = (Gtk.Window) get_root () }; var continue_button = dialog.add_button (_("Restart"), Gtk.ResponseType.ACCEPT); - continue_button.get_style_context ().add_class (Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); + continue_button.add_css_class (Granite.STYLE_CLASS_DESTRUCTIVE_ACTION); dialog.response.connect ((result) => { dialog.destroy (); @@ -423,7 +429,7 @@ public class About.FirmwareView : Granite.SimpleSettingsPage { ) { badge_icon = new ThemedIcon ("dialog-error"), modal = true, - transient_for = (Gtk.Window) get_toplevel () + transient_for = (Gtk.Window) get_root () }; message_dialog.show_error_details (error.message); message_dialog.present ();