Skip to content

Commit

Permalink
Layout adjustments in the "Boot Code Options" tab
Browse files Browse the repository at this point in the history
  • Loading branch information
dgdavid committed Feb 8, 2019
1 parent e80fc3e commit 41badf1
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions src/lib/bootloader/grub2_widgets.rb
Expand Up @@ -703,7 +703,6 @@ def contents
textdomain "bootloader"

VBox(
VSpacing(1),
Frame(
_("Boot Loader Location"),
HBox(
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 41badf1

Please sign in to comment.