Non-Touch: fix hang on bottom config menu navigation (#6047)

pull/5999/head
poire-z 4 years ago committed by GitHub
parent 8e831eb756
commit abdaf6e18c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -558,6 +558,7 @@ function ConfigOption:init()
thin_grey_style = true, thin_grey_style = true,
font_face = item_font_face, font_face = item_font_face,
font_size = item_font_size, font_size = item_font_size,
name = self.options[c].name,
num_buttons = #self.options[c].values, num_buttons = #self.options[c].values,
position = self.options[c].default_pos, position = self.options[c].default_pos,
callback = function(arg) callback = function(arg)
@ -610,16 +611,14 @@ end
function ConfigOption:_itemGroupToLayoutLine(option_items_group) function ConfigOption:_itemGroupToLayoutLine(option_items_group)
local layout_line = {} local layout_line = {}
for k, v in pairs(option_items_group) do -- Insert items (skpping item_spacing without a .name attribute),
--pad the beginning of the line in the layout to align it with the current selected tab -- skipping indices at the beginning of the line in the layout
if type(k) == "number" then -- to align it with the current selected tab
layout_line[k + self.config.panel_index-1] = v local j = self.config.panel_index
end for i, v in ipairs(option_items_group) do
end if v.name then
for k, v in pairs(layout_line) do layout_line[j] = v
--remove item_spacing (all widget have the name property) j = j + 1
if not v.name then
table.remove(layout_line,k)
end end
end end
return layout_line return layout_line

Loading…
Cancel
Save