1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-17 16:57:39 +00:00

fix menu separators + sys dir restructure

This commit is contained in:
kepler155c@gmail.com
2019-03-31 15:16:45 -04:00
parent 19159730a4
commit 737ac095de
25 changed files with 16 additions and 13 deletions

View File

@@ -24,6 +24,7 @@ function UI.DropMenu:setParent()
for _,child in ipairs(self.children) do
child.width = maxWidth + 2
if child.spacer then
child.inactive = true
child.text = string.rep('-', child.width - 2)
end
end

View File

@@ -25,8 +25,6 @@ UI.MenuBar.defaults = {
showBackButton = false,
buttonClass = 'MenuItem',
}
UI.MenuBar.spacer = { spacer = true, text = 'spacer', inactive = true }
function UI.MenuBar:postInit()
self:addButtons(self.buttons)
end
@@ -42,7 +40,7 @@ function UI.MenuBar:addButtons(buttons)
else
local buttonProperties = {
x = self.lastx,
width = #button.text + self.spacing,
width = #(button.text or 'button') + self.spacing,
centered = false,
}
self.lastx = self.lastx + buttonProperties.width