Ui enhancements 2.0 (#31)

* canvas overhaul

* minor tweaks

* list mode for overview

* bugfixes + tweaks for editor 2.0

* minor tweaks

* more editor work

* refactor + new transitions

* use layout() where appropriate and cleanup

* mouse triple click + textEntry scroll ind

* cleanup

* cleanup + theme editor

* color rework + cleanup

* changes for deprecated ui methods

* can now use named colors
This commit was merged in pull request #31.
This commit is contained in:
kepler155c
2020-04-21 22:40:59 -06:00
committed by GitHub
parent cdd0b6c4d2
commit 7224d441ca
92 changed files with 2471 additions and 1773 deletions

View File

@@ -25,9 +25,6 @@ function UI.Wizard:postInit()
}
Util.merge(self, self.pages)
--for _, child in pairs(self.pages) do
-- child.ey = -2
--end
end
function UI.Wizard:add(pages)
@@ -50,9 +47,8 @@ end
function UI.Wizard:enable(...)
self.enabled = true
self.index = 1
self.transitionHint = nil
local initial = self:getPage(1)
for _,child in pairs(self.children) do
for child in self:eachChild() do
if child == initial or not child.index then
child:enable(...)
else
@@ -93,12 +89,13 @@ function UI.Wizard:eventHandler(event)
elseif event.type == 'enable_view' then
local current = event.next or event.prev
if not current then error('property "index" is required on wizard pages') end
local hint
if event.current then
if event.next then
self.transitionHint = 'slideLeft'
hint = 'slideLeft'
elseif event.prev then
self.transitionHint = 'slideRight'
hint = 'slideRight'
end
event.current:disable()
end
@@ -117,6 +114,7 @@ function UI.Wizard:eventHandler(event)
self.nextButton.event = 'wizard_complete'
end
-- a new current view
current.transitionHint = hint
current:enable()
current:emit({ type = 'view_enabled', view = current })
self:draw()