2019-02-06 04:03:57 +00:00
|
|
|
local class = require('class')
|
|
|
|
local UI = require('ui')
|
|
|
|
|
|
|
|
UI.ActiveLayer = class(UI.Window)
|
|
|
|
UI.ActiveLayer.defaults = {
|
|
|
|
UIElement = 'ActiveLayer',
|
|
|
|
}
|
2019-02-26 23:03:09 +00:00
|
|
|
function UI.ActiveLayer:layout()
|
|
|
|
UI.Window.layout(self)
|
|
|
|
if not self.canvas then
|
|
|
|
self.canvas = self:addLayer()
|
|
|
|
else
|
|
|
|
self.canvas:resize(self.width, self.height)
|
|
|
|
end
|
2019-02-06 04:03:57 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
function UI.ActiveLayer:enable(...)
|
|
|
|
self.canvas:raise()
|
|
|
|
self.canvas:setVisible(true)
|
|
|
|
UI.Window.enable(self, ...)
|
|
|
|
if self.parent.transitionHint then
|
|
|
|
self:addTransition(self.parent.transitionHint)
|
|
|
|
end
|
|
|
|
self:focusFirst()
|
|
|
|
end
|
|
|
|
|
|
|
|
function UI.ActiveLayer:disable()
|
|
|
|
if self.canvas then
|
|
|
|
self.canvas:setVisible(false)
|
|
|
|
end
|
|
|
|
UI.Window.disable(self)
|
|
|
|
end
|