From abdaf6e18c1c03c3ea7e047194e10887845ecfb9 Mon Sep 17 00:00:00 2001 From: poire-z Date: Tue, 14 Apr 2020 12:20:11 +0200 Subject: [PATCH] Non-Touch: fix hang on bottom config menu navigation (#6047) --- frontend/ui/widget/configdialog.lua | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/frontend/ui/widget/configdialog.lua b/frontend/ui/widget/configdialog.lua index 4135ecc2f..e92055182 100644 --- a/frontend/ui/widget/configdialog.lua +++ b/frontend/ui/widget/configdialog.lua @@ -558,6 +558,7 @@ function ConfigOption:init() thin_grey_style = true, font_face = item_font_face, font_size = item_font_size, + name = self.options[c].name, num_buttons = #self.options[c].values, position = self.options[c].default_pos, callback = function(arg) @@ -610,16 +611,14 @@ end function ConfigOption:_itemGroupToLayoutLine(option_items_group) local layout_line = {} - for k, v in pairs(option_items_group) do - --pad the beginning of the line in the layout to align it with the current selected tab - if type(k) == "number" then - layout_line[k + self.config.panel_index-1] = v - end - end - for k, v in pairs(layout_line) do - --remove item_spacing (all widget have the name property) - if not v.name then - table.remove(layout_line,k) + -- Insert items (skpping item_spacing without a .name attribute), + -- skipping indices at the beginning of the line in the layout + -- to align it with the current selected tab + local j = self.config.panel_index + for i, v in ipairs(option_items_group) do + if v.name then + layout_line[j] = v + j = j + 1 end end return layout_line