From 41badf1d7522f843b10ab73e9de067657f635add Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20D=C3=ADaz=20Gonz=C3=A1lez?= Date: Fri, 8 Feb 2019 08:46:15 +0000 Subject: [PATCH] Layout adjustments in the "Boot Code Options" tab --- src/lib/bootloader/grub2_widgets.rb | 31 ++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/src/lib/bootloader/grub2_widgets.rb b/src/lib/bootloader/grub2_widgets.rb index ac355d40b..307cbc30b 100644 --- a/src/lib/bootloader/grub2_widgets.rb +++ b/src/lib/bootloader/grub2_widgets.rb @@ -703,7 +703,6 @@ def contents textdomain "bootloader" VBox( - VSpacing(1), Frame( _("Boot Loader Location"), HBox( @@ -870,8 +869,16 @@ def label def contents VBox( - Left(LoaderTypeWidget.new), + VSpacing(1), + HBox( + HSpacing(1), + Left(LoaderTypeWidget.new) + ), + VSpacing(1), *widgets, + VSpacing(1), + pmbr_widget, + device_map_button, VStretch() ) end @@ -889,14 +896,28 @@ def widgets w << SecureBootWidget.new if secure_boot_widget? w << TrustedBootWidget.new if trusted_boot_widget? - w << PMBRWidget.new if pmbr_widget? - w << DeviceMapWidget.new if device_map_button? w.map do |widget| - MarginBox(1, 0.5, Left(widget)) + MarginBox(horizontal_margin, 0, Left(widget)) end end + def pmbr_widget + return Empty() unless pmbr_widget? + + MarginBox(1, 0, Left(PMBRWidget.new)) + end + + def device_map_button + return Empty() unless device_map_button? + + MarginBox(1, 0, Left(DeviceMapWidget.new)) + end + + def horizontal_margin + @horizontal_margin ||= Yast::UI.TextMode ? 1 : 1.5 + end + def loader_location_widget? (Yast::Arch.x86_64 || Yast::Arch.i386 || Yast::Arch.ppc) && grub2.name == "grub2" end