1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-20 18:27:40 +00:00

redo tabs + wizard

This commit is contained in:
kepler155c@gmail.com
2017-10-18 19:51:55 -04:00
parent f6d1cfc7ee
commit fb0f3e567a
4 changed files with 204 additions and 124 deletions

View File

@@ -90,11 +90,11 @@ local categories = { }
for _,f in pairs(applications) do
if not categories[f.category] then
categories[f.category] = true
table.insert(buttons, { text = f.category, event = 'category' })
table.insert(buttons, { text = f.category })
end
end
table.sort(buttons, function(a, b) return a.text < b.text end)
table.insert(buttons, 1, { text = 'Recent', event = 'category' })
table.insert(buttons, 1, { text = 'Recent' })
table.insert(buttons, { text = '+', event = 'new' })
local function parseIcon(iconText)
@@ -329,8 +329,7 @@ end
function page:eventHandler(event)
if event.type == 'category' then
self.tabBar:selectTab(event.button.text)
if event.type == 'tab_select' then
self.container:setCategory(event.button.text, true)
self.container:draw()

View File

@@ -97,6 +97,7 @@ local systemPage = UI.Page {
info = UI.TextArea {
x = 2, ex = -2,
y = 7,
inactive = true,
value = 'Add a password to enable other computers to connect to this one.',
}
},
@@ -150,7 +151,7 @@ if settings then
end
systemPage.tabs:add({
systemTab = UI.Window {
settingsTab = UI.Window {
tabTitle = 'Settings',
grid = UI.Grid {
y = 1,
@@ -166,7 +167,7 @@ if settings then
},
}
})
function systemPage.tabs.systemTab:eventHandler(event)
function systemPage.tabs.settingsTab:eventHandler(event)
if event.type == 'grid_select' then
event.selected.value = not event.selected.value
settings.set(event.selected.name, event.selected.value)
@@ -187,7 +188,6 @@ function systemPage.tabs.pathTab.grid:draw()
end
function systemPage.tabs.pathTab:eventHandler(event)
if event.type == 'update_path' then
env.path = self.entry.value
self.grid:setIndex(self.grid:getIndex())
@@ -208,7 +208,6 @@ function systemPage.tabs.aliasTab.grid:draw()
end
function systemPage.tabs.aliasTab:eventHandler(event)
if event.type == 'delete_alias' then
env.aliases[self.grid:getSelected().alias] = nil
self.grid:setIndex(self.grid:getIndex())
@@ -254,7 +253,6 @@ function systemPage.tabs.infoTab:eventHandler(event)
end
function systemPage:eventHandler(event)
if event.type == 'quit' then
UI:exitPullEvents()
elseif event.type == 'tab_activate' then