diff --git a/src/Views/AbstractInstallerView.vala b/src/Views/AbstractInstallerView.vala index 4465b6440..d36127bdb 100644 --- a/src/Views/AbstractInstallerView.vala +++ b/src/Views/AbstractInstallerView.vala @@ -21,7 +21,8 @@ public abstract class AbstractInstallerView : Gtk.Box { public signal void cancel (); protected Gtk.Grid content_area; - protected Gtk.ButtonBox action_area; + protected Gtk.Box action_box_start; + protected Gtk.Box action_box_end; protected AbstractInstallerView (bool cancellable = false) { Object (cancellable: cancellable); @@ -36,29 +37,38 @@ public abstract class AbstractInstallerView : Gtk.Box { orientation = Gtk.Orientation.VERTICAL }; - action_area = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL) { - layout_style = Gtk.ButtonBoxStyle.END, - margin_end = 10, - margin_start = 10, - spacing = 6 + action_box_end = new Gtk.Box (HORIZONTAL, 6) { + halign = END, + hexpand = true, + homogeneous = true }; - if (cancellable) { - var cancel_button = new Gtk.Button.with_label (_("Cancel Installation")); - cancel_button.clicked.connect (() => { - cancel (); - }); + action_box_start = new Gtk.Box (HORIZONTAL, 6) { + homogeneous = true + }; - action_area.add (cancel_button); - } + var action_area = new Gtk.Box (HORIZONTAL, 12) { + margin_start = 10, + margin_end = 10 + }; + action_area.add (action_box_start); if (Installer.App.test_mode) { var test_label = new Gtk.Label (_("Test Mode")); test_label.get_style_context ().add_class (Gtk.STYLE_CLASS_ERROR); action_area.add (test_label); - action_area.set_child_non_homogeneous (test_label, true); - action_area.set_child_secondary (test_label, true); + } + + action_area.add (action_box_end); + + if (cancellable) { + var cancel_button = new Gtk.Button.with_label (_("Cancel Installation")); + cancel_button.clicked.connect (() => { + cancel (); + }); + + action_box_end.add (cancel_button); } orientation = VERTICAL; diff --git a/src/Views/CheckView.vala b/src/Views/CheckView.vala index 9b042801b..4fd4b03c3 100644 --- a/src/Views/CheckView.vala +++ b/src/Views/CheckView.vala @@ -86,7 +86,7 @@ public class Installer.CheckView : AbstractInstallerView { ignore_button.get_style_context ().add_class (Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); ignore_button.clicked.connect (() => next_step ()); - action_area.add (ignore_button); + action_box_end.add (ignore_button); bool minimum_specs = true; diff --git a/src/Views/DiskView.vala b/src/Views/DiskView.vala index f2a6ed7e3..f0bad0b15 100644 --- a/src/Views/DiskView.vala +++ b/src/Views/DiskView.vala @@ -111,7 +111,7 @@ public class Installer.DiskView : AbstractInstallerView { next_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); next_button.clicked.connect (() => ((Hdy.Deck) get_parent ()).navigate (FORWARD)); - action_area.add (next_button); + action_box_end.add (next_button); show_all (); } diff --git a/src/Views/DriversView.vala b/src/Views/DriversView.vala index 62ebf083d..204e71aa1 100644 --- a/src/Views/DriversView.vala +++ b/src/Views/DriversView.vala @@ -105,8 +105,8 @@ next_button.get_style_context ().add_class (Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); next_button.clicked.connect (() => next_step ()); - action_area.add (back_button); - action_area.add (next_button); + action_box_end.add (back_button); + action_box_end.add (next_button); drivers_check.toggled.connect (() => { unowned var configuration = Configuration.get_default (); diff --git a/src/Views/EncryptView.vala b/src/Views/EncryptView.vala index 83e30952f..db88ae8a0 100644 --- a/src/Views/EncryptView.vala +++ b/src/Views/EncryptView.vala @@ -170,9 +170,9 @@ public class EncryptView : AbstractInstallerView { }; next_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); - action_area.add (back_button); - action_area.add (encrypt_button); - action_area.add (next_button); + action_box_end.add (back_button); + action_box_end.add (encrypt_button); + action_box_end.add (next_button); next_button.grab_focus (); diff --git a/src/Views/ErrorView.vala b/src/Views/ErrorView.vala index 23990f8a1..7e331b734 100644 --- a/src/Views/ErrorView.vala +++ b/src/Views/ErrorView.vala @@ -119,9 +119,9 @@ public class ErrorView : AbstractInstallerView { var install_button = new Gtk.Button.with_label (_("Try Installing Again")); install_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); - action_area.add (restart_button); - action_area.add (demo_button); - action_area.add (install_button); + action_box_end.add (restart_button); + action_box_end.add (demo_button); + action_box_end.add (install_button); restart_button.clicked.connect (Utils.restart); diff --git a/src/Views/KeyboardLayoutView.vala b/src/Views/KeyboardLayoutView.vala index 81f7db05e..db44a2fc2 100644 --- a/src/Views/KeyboardLayoutView.vala +++ b/src/Views/KeyboardLayoutView.vala @@ -59,8 +59,8 @@ public class KeyboardLayoutView : AbstractInstallerView { }; next_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); - action_area.add (back_button); - action_area.add (next_button); + action_box_end.add (back_button); + action_box_end.add (next_button); input_variant_widget.main_listbox.set_sort_func ((row1, row2) => { return ((LayoutRow) row1).layout.description.collate (((LayoutRow) row2).layout.description); diff --git a/src/Views/LanguageView.vala b/src/Views/LanguageView.vala index 535a44126..c58fe7bf2 100644 --- a/src/Views/LanguageView.vala +++ b/src/Views/LanguageView.vala @@ -114,7 +114,7 @@ public class Installer.LanguageView : AbstractInstallerView { next_button.sensitive = false; next_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); - action_area.add (next_button); + action_box_end.add (next_button); lang_variant_widget.main_listbox.row_selected.connect (row_selected); lang_variant_widget.main_listbox.select_row (lang_variant_widget.main_listbox.get_row_at_index (0)); diff --git a/src/Views/PartitioningView.vala b/src/Views/PartitioningView.vala index a36309e78..358931766 100644 --- a/src/Views/PartitioningView.vala +++ b/src/Views/PartitioningView.vala @@ -127,11 +127,9 @@ public class Installer.PartitioningView : AbstractInstallerView { next_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); next_button.sensitive = false; - action_area.add (modify_partitions_button); - action_area.set_child_secondary (modify_partitions_button, true); - action_area.set_child_non_homogeneous (modify_partitions_button, true); - action_area.add (back_button); - action_area.add (next_button); + action_box_start.add (modify_partitions_button); + action_box_end.add (back_button); + action_box_end.add (next_button); back_button.clicked.connect (() => ((Hdy.Deck) get_parent ()).navigate (Hdy.NavigationDirection.BACK)); next_button.clicked.connect (() => next_step ()); diff --git a/src/Views/SuccessView.vala b/src/Views/SuccessView.vala index b4eaf9cb8..fbfea9743 100644 --- a/src/Views/SuccessView.vala +++ b/src/Views/SuccessView.vala @@ -67,8 +67,8 @@ public class SuccessView : AbstractInstallerView { restart_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); restart_button.clicked.connect (Utils.restart); - action_area.add (shutdown_button); - action_area.add (restart_button); + action_box_end.add (shutdown_button); + action_box_end.add (restart_button); update_secondary_label (); diff --git a/src/Views/TryInstallView.vala b/src/Views/TryInstallView.vala index 2215931a2..f20ec8728 100644 --- a/src/Views/TryInstallView.vala +++ b/src/Views/TryInstallView.vala @@ -88,8 +88,8 @@ public class Installer.TryInstallView : AbstractInstallerView { }; next_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); - action_area.add (back_button); - action_area.add (next_button); + action_box_end.add (back_button); + action_box_end.add (next_button); back_button.clicked.connect (() => ((Hdy.Deck) get_parent ()).navigate (Hdy.NavigationDirection.BACK));