1
0
mirror of https://github.com/kepler155c/opus synced 2025-12-20 07:08:06 +00:00

custom help files + redo System UI

This commit is contained in:
kepler155c@gmail.com
2018-12-22 22:11:16 -05:00
parent 3de03bef22
commit 26564cbcc1
15 changed files with 541 additions and 292 deletions

View File

@@ -2250,6 +2250,13 @@ function UI.Tabs:add(children)
end
end
function UI.Tabs:selectTab(tab)
local menuItem = Util.find(self.tabBar:getFocusables(), 'tabUid', tab.uid)
if menuItem then
self.tabBar:emit({ type = 'tab_select', button = { uid = menuItem.uid } })
end
end
function UI.Tabs:enable()
self.enabled = true
self.tabBar:enable()
@@ -2999,6 +3006,7 @@ function UI.Chooser:eventHandler(event)
if event.key == 'right' or event.key == 'space' then
local _,k = Util.find(self.choices, 'value', self.value)
local choice
if not k then k = 1 end
if k and k < #self.choices then
choice = self.choices[k+1]
else
@@ -3021,7 +3029,7 @@ function UI.Chooser:eventHandler(event)
self:draw()
return true
end
elseif event.type == 'mouse_click' then
elseif event.type == 'mouse_click' or event.type == 'mouse_doubleclick' then
if event.x == 1 then
self:emit({ type = 'key', key = 'left' })
return true