mirror of
https://github.com/airstruck/luigi.git
synced 2025-12-19 02:16:43 +00:00
add dark theme
This commit is contained in:
@@ -170,8 +170,16 @@ local function initialize (self)
|
||||
self.flow = 'x'
|
||||
self:addChild { icon = icon, width = self.height }
|
||||
self:addChild { text = text, width = textWidth }
|
||||
self:addChild { text = key, align = 'middle right',
|
||||
minwidth = self.height, color = keyColor, type = edgeType }
|
||||
self:addChild {
|
||||
type = edgeType,
|
||||
text = key,
|
||||
align = 'middle right',
|
||||
minwidth = self.height,
|
||||
color = function ()
|
||||
local c = self.color or { 0, 0, 0 }
|
||||
return { c[1], c[2], c[3], (c[4] or 256) / 2 }
|
||||
end
|
||||
}
|
||||
|
||||
self.icon = nil
|
||||
self.text = nil
|
||||
|
||||
@@ -183,8 +183,13 @@ return function (self)
|
||||
end
|
||||
|
||||
self.value = self.value or self.text or ''
|
||||
|
||||
self.text = ''
|
||||
self.highlight = self.highlight or { 0x80, 0x80, 0x80 }
|
||||
|
||||
if not self.highlight then
|
||||
self.highlight = { 0x80, 0x80, 0x80 }
|
||||
end
|
||||
|
||||
self.scrollX = 0
|
||||
|
||||
setCaretFromText(self, self.value)
|
||||
@@ -262,20 +267,18 @@ return function (self)
|
||||
Backend.setFont(font)
|
||||
|
||||
-- draw highlight
|
||||
Backend.setColor(self.highlight)
|
||||
Backend.drawRectangle('fill', startX, y, width, height)
|
||||
if Backend.getTime() % 2 < 1.75 then
|
||||
Backend.setColor(color)
|
||||
Backend.drawRectangle('fill', endX, y, 1, height)
|
||||
if self.focused then
|
||||
Backend.setColor(self.highlight)
|
||||
Backend.drawRectangle('fill', startX, y, width, height)
|
||||
if Backend.getTime() % 2 < 1.75 then
|
||||
Backend.setColor(color)
|
||||
Backend.drawRectangle('fill', endX, y, 1, height)
|
||||
end
|
||||
end
|
||||
|
||||
-- draw text
|
||||
Backend.setColor(color)
|
||||
Backend.print(self.value, x - self.scrollX, textTop)
|
||||
if not self.focused then
|
||||
Backend.pop()
|
||||
return
|
||||
end
|
||||
|
||||
Backend.pop()
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user