mirror of
https://github.com/airstruck/luigi.git
synced 2026-01-11 08:48:23 +00:00
minor
This commit is contained in:
@@ -192,6 +192,8 @@ return function (config)
|
|||||||
},
|
},
|
||||||
status = {
|
status = {
|
||||||
type = { 'Line', 'Control' },
|
type = { 'Line', 'Control' },
|
||||||
|
background = backColor,
|
||||||
|
color = textColor,
|
||||||
},
|
},
|
||||||
stepper = {
|
stepper = {
|
||||||
type = { 'Control' },
|
type = { 'Control' },
|
||||||
|
|||||||
@@ -168,16 +168,16 @@ local function initialize (self)
|
|||||||
local font = self:getFont()
|
local font = self:getFont()
|
||||||
local pad = self.padding or 0
|
local pad = self.padding or 0
|
||||||
local isSubmenu = self.parentMenu and self.parentMenu.parentMenu
|
local isSubmenu = self.parentMenu and self.parentMenu.parentMenu
|
||||||
local text, key, icon = self.text or '', self.key or '', self.icon
|
local text, shortcut, icon = self.text or '', self.shortcut or '', self.icon
|
||||||
local textWidth = font:getAdvance(text) + pad * 2
|
local textWidth = font:getAdvance(text) + pad * 2
|
||||||
|
|
||||||
if isSubmenu then
|
if isSubmenu then
|
||||||
local edgeType
|
local edgeType
|
||||||
if #self.items > 0 then
|
if #self.items > 0 then
|
||||||
key = ' '
|
shortcut = ' '
|
||||||
edgeType = 'menu.expander'
|
edgeType = 'menu.expander'
|
||||||
else
|
else
|
||||||
key = key:gsub('%f[%w].', string.upper) -- :gsub('-', '+')
|
shortcut = shortcut:gsub('%f[%w].', string.upper) -- :gsub('-', '+')
|
||||||
end
|
end
|
||||||
self.height = font:getLineHeight() + pad * 2
|
self.height = font:getLineHeight() + pad * 2
|
||||||
self.flow = 'x'
|
self.flow = 'x'
|
||||||
@@ -185,7 +185,7 @@ local function initialize (self)
|
|||||||
self:addChild { text = text, width = textWidth }
|
self:addChild { text = text, width = textWidth }
|
||||||
self:addChild {
|
self:addChild {
|
||||||
type = edgeType,
|
type = edgeType,
|
||||||
text = key,
|
text = shortcut,
|
||||||
align = 'middle right',
|
align = 'middle right',
|
||||||
minwidth = self.height,
|
minwidth = self.height,
|
||||||
color = function ()
|
color = function ()
|
||||||
|
|||||||
Reference in New Issue
Block a user