Skip to content

Commit

Permalink
Fix RTL support in system role selection screen
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Apr 25, 2018
1 parent a382e8f commit d3e808c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lib/installation/select_system_role.rb
Expand Up @@ -22,6 +22,7 @@
require "ui/installation_dialog"
require "installation/services"
require "installation/system_role"
require "ui/text_helpers"

Yast.import "GetInstArgs"
Yast.import "Packages"
Expand All @@ -32,6 +33,8 @@

module Installation
class SelectSystemRole < ::UI::InstallationDialog
include UI::TextHelpers

class << self
# once the user selects a role, remember it in case they come back
attr_accessor :original_role_id
Expand Down Expand Up @@ -254,7 +257,7 @@ def role_buttons(selected_role_id:)
VBox(
Left(Label(intro_text)),
VSpacing(2),
RichText(Id(:roles_richtext), role_rt_radios.join("\n"))
RichText(Id(:roles_richtext), div_with_direction(role_rt_radios.join("\n")))
)
end

Expand Down Expand Up @@ -283,7 +286,10 @@ def richtext_radiobutton_gui(id:, label:, selected:)
installation = ENV["Y2STYLE"] == "installation.qss"
if installation
image = selected ? "inst_radio-button-checked.png" : "inst_radio-button-unchecked.png"
bullet = "<img src=\"#{IMAGE_DIR}/#{image}\"></img>"
# NOTE: due to a Qt bug, the first image does not get rendered properly. So we are
# rendering it twice (one with height and width set to "0").
bullet = "<img src=\"#{IMAGE_DIR}/#{image}\" height=\"0\" width=\"0\"></img>" \
"<img src=\"#{IMAGE_DIR}/#{image}\"></img>"
else
bullet = selected ? BUTTON_ON : BUTTON_OFF
end
Expand Down

0 comments on commit d3e808c

Please sign in to comment.