1
0
mirror of https://github.com/kepler155c/opus synced 2025-01-20 20:26:53 +00:00

canvas use in UI overhaul

This commit is contained in:
kepler155c@gmail.com 2019-01-30 15:53:09 -05:00
parent 3574d26caa
commit 817c345672

View File

@ -1122,18 +1122,6 @@ function UI.Page:postInit()
self.canvas:clear(self.backgroundColor, self.textColor) self.canvas:clear(self.backgroundColor, self.textColor)
end end
function UI.Page:setParent()
UI.Window.setParent(self)
--[[
if self.z then
self.canvas = self:addLayer(self.backgroundColor, self.textColor)
self.canvas:clear(self.backgroundColor, self.textColor)
else
self.canvas = self.parent.canvas
end
]]
end
function UI.Page:enable() function UI.Page:enable()
self.canvas.visible = true self.canvas.visible = true
UI.Window.enable(self) UI.Window.enable(self)
@ -1144,9 +1132,7 @@ function UI.Page:enable()
end end
function UI.Page:disable() function UI.Page:disable()
if self.z then self.canvas.visible = false
self.canvas.visible = false
end
UI.Window.disable(self) UI.Window.disable(self)
end end
@ -2318,21 +2304,22 @@ UI.Tab.defaults = {
UIElement = 'Tab', UIElement = 'Tab',
tabTitle = 'tab', tabTitle = 'tab',
backgroundColor = colors.cyan, backgroundColor = colors.cyan,
y = 2,
} }
function UI.Tab:setParent() function UI.Tab:setParent()
UI.Window.setParent(self) UI.Window.setParent(self)
self.canvas = self:addLayer() --self.canvas = self:addLayer()
end end
function UI.Tab:enable(...) function UI.Tab:enable(...)
self.canvas:setVisible(true) --self.canvas:setVisible(true)
UI.Window.enable(self, ...) UI.Window.enable(self, ...)
self:addTransition(self.parent.transitionHint or 'slideLeft') --self:addTransition(self.parent.transitionHint or 'slideLeft')
self:focusFirst() self:focusFirst()
end end
function UI.Tab:disable() function UI.Tab:disable()
self.canvas:setVisible(false) --self.canvas:setVisible(false)
UI.Window.disable(self) UI.Window.disable(self)
end end