diff --git a/frontend/ui/data/creoptions.lua b/frontend/ui/data/creoptions.lua index 1af8f4b22..db46977b7 100644 --- a/frontend/ui/data/creoptions.lua +++ b/frontend/ui/data/creoptions.lua @@ -164,6 +164,7 @@ This is disabled in scroll mode. Switching from page mode with two columns to sc more_options = true, more_options_param = { name_text = _("Left/Right Margins"), + widget_width_factor = 0.6, left_min = 0, left_max = 140, left_step = 1, @@ -230,6 +231,7 @@ In the top menu → Settings → Status bar, you can choose whether the bottom m name_text = _("Top/Bottom Margins"), names = { "t_page_margin", "b_page_margin" }, event = "SetPageTopAndBottomMargin", + widget_width_factor = 0.6, left_text = _("Top"), left_min = 0, left_max = 140, @@ -280,6 +282,7 @@ In the top menu → Settings → Status bar, you can choose whether the bottom m name_text = _("Top/Bottom Margins"), names = { "t_page_margin", "b_page_margin" }, event = "SetPageTopAndBottomMargin", + widget_width_factor = 0.6, left_text = _("Top"), left_min = 0, left_max = 140, diff --git a/frontend/ui/widget/configdialog.lua b/frontend/ui/widget/configdialog.lua index 0c9515f11..0b4ccefb7 100644 --- a/frontend/ui/widget/configdialog.lua +++ b/frontend/ui/widget/configdialog.lua @@ -1153,6 +1153,7 @@ function ConfigDialog:onConfigMoreChoose(values, name, event, args, name_text, m curr_values = self.configurable[name] end widget = DoubleSpinWidget:new{ + width_factor = more_options_param.widget_width_factor, title_text = name_text or _("Set values"), info_text = more_options_param.info_text, left_text = more_options_param.left_text, @@ -1250,6 +1251,7 @@ function ConfigDialog:onConfigMoreChoose(values, name, event, args, name_text, m end end widget = SpinWidget:new{ + width_factor = more_options_param.widget_width_factor, title_text = name_text or _("Set value"), info_text = more_options_param.info_text, value = curr_items, diff --git a/frontend/ui/widget/doublespinwidget.lua b/frontend/ui/widget/doublespinwidget.lua index 533a81e32..bc6557a42 100644 --- a/frontend/ui/widget/doublespinwidget.lua +++ b/frontend/ui/widget/doublespinwidget.lua @@ -26,6 +26,7 @@ local DoubleSpinWidget = InputContainer:new{ title_face = Font:getFace("x_smalltfont"), info_text = nil, width = nil, + width_factor = nil, -- number between 0 and 1, factor to the smallest of screen width and height height = nil, left_min = 1, left_max = 20, @@ -54,7 +55,12 @@ local DoubleSpinWidget = InputContainer:new{ function DoubleSpinWidget:init() self.screen_width = Screen:getWidth() self.screen_height = Screen:getHeight() - self.width = self.width or math.floor(math.min(self.screen_width, self.screen_height) * 0.6) + if not self.width then + if not self.width_factor then + self.width_factor = 0.8 -- default if no width speficied + end + self.width = math.floor(math.min(self.screen_width, self.screen_height) * self.width_factor) + end if Device:hasKeys() then self.key_events = { Close = { {"Back"}, doc = "close time widget" } diff --git a/frontend/ui/widget/spinwidget.lua b/frontend/ui/widget/spinwidget.lua index ca7f6ef1a..c3b713c46 100644 --- a/frontend/ui/widget/spinwidget.lua +++ b/frontend/ui/widget/spinwidget.lua @@ -25,6 +25,7 @@ local SpinWidget = InputContainer:new{ title_face = Font:getFace("x_smalltfont"), info_text = nil, width = nil, + width_factor = nil, -- number between 0 and 1, factor to the smallest of screen width and height height = nil, value_table = nil, value_index = nil, @@ -50,7 +51,12 @@ local SpinWidget = InputContainer:new{ function SpinWidget:init() self.screen_width = Screen:getWidth() self.screen_height = Screen:getHeight() - self.width = self.width or math.floor(math.min(self.screen_width, self.screen_height) * 0.6) + if not self.width then + if not self.width_factor then + self.width_factor = 0.6 -- default if no width speficied + end + self.width = math.floor(math.min(self.screen_width, self.screen_height) * self.width_factor) + end if Device:hasKeys() then self.key_events = { Close = { {"Back"}, doc = "close spin widget" }