mirror of
https://github.com/airstruck/luigi.git
synced 2025-12-19 02:16:43 +00:00
Formalize type attribute and support it in styles
This commit is contained in:
@@ -9,6 +9,8 @@ not be explicitly created.
|
||||
--]]--
|
||||
local ROOT = (...):gsub('[^.]*.[^.]*.[^.]*$', '')
|
||||
|
||||
local Backend = require(ROOT .. 'backend')
|
||||
|
||||
local Layout, Event
|
||||
|
||||
local function addLayoutChildren (self)
|
||||
@@ -141,12 +143,14 @@ local function registerLayoutEvents (self)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
menuLayout:onEnter(activate)
|
||||
menuLayout:onPressEnter(activate)
|
||||
end
|
||||
|
||||
local function initialize (self)
|
||||
if not self.fontData then
|
||||
self.fontData = Backend.Font(self.font, self.size)
|
||||
end
|
||||
local pad = self.padding or 0
|
||||
local isSubmenu = self.parentMenu and self.parentMenu.parentMenu
|
||||
local text, key, icon = self.text or '', self.key or '', self.icon
|
||||
|
||||
@@ -178,6 +178,10 @@ local function insertText (self, newText)
|
||||
end
|
||||
|
||||
return function (self)
|
||||
if not self.fontData then
|
||||
self.fontData = Backend.Font(self.font, self.size)
|
||||
end
|
||||
|
||||
self.value = self.value or self.text or ''
|
||||
self.text = ''
|
||||
self.highlight = self.highlight or { 0x80, 0x80, 0x80 }
|
||||
|
||||
Reference in New Issue
Block a user