mirror of
https://github.com/airstruck/luigi.git
synced 2026-01-10 08:18:22 +00:00
minor tweaks
This commit is contained in:
@@ -23,9 +23,6 @@ local style = {
|
|||||||
toolButton_not_hovered = {
|
toolButton_not_hovered = {
|
||||||
slices = false,
|
slices = false,
|
||||||
},
|
},
|
||||||
toolButton_hovered = {
|
|
||||||
tint = { 200, 255, 200 },
|
|
||||||
},
|
|
||||||
statusbar = {
|
statusbar = {
|
||||||
style = 'panel',
|
style = 'panel',
|
||||||
align = 'left middle',
|
align = 'left middle',
|
||||||
@@ -88,7 +85,7 @@ local mainForm = { title = "Test window", id = 'mainWindow', type = 'panel',
|
|||||||
local layout = Layout(mainForm)
|
local layout = Layout(mainForm)
|
||||||
|
|
||||||
layout:setStyle(style)
|
layout:setStyle(style)
|
||||||
layout:setTheme(require 'luigi.theme.light' { highlight = { 150, 255, 150 } })
|
-- layout:setTheme(require 'luigi.theme.light')
|
||||||
|
|
||||||
layout.leftSideBox:addChild {
|
layout.leftSideBox:addChild {
|
||||||
text = 'Alright man this is a great song\nwith a really long title...',
|
text = 'Alright man this is a great song\nwith a really long title...',
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ local weakValueMeta = { __mode = 'v' }
|
|||||||
function Layout:constructor (data)
|
function Layout:constructor (data)
|
||||||
self.accelerators = {}
|
self.accelerators = {}
|
||||||
self:setStyle()
|
self:setStyle()
|
||||||
self:setTheme()
|
self:setTheme(require(ROOT .. 'theme.light'))
|
||||||
|
|
||||||
self.isMousePressed = false
|
self.isMousePressed = false
|
||||||
self.isManagingInput = false
|
self.isManagingInput = false
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ return function (config)
|
|||||||
local backColor = config.backColor or { 240, 240, 240 }
|
local backColor = config.backColor or { 240, 240, 240 }
|
||||||
local lineColor = config.lineColor or { 220, 220, 220 }
|
local lineColor = config.lineColor or { 220, 220, 220 }
|
||||||
local white = config.white or { 255, 255, 255 }
|
local white = config.white or { 255, 255, 255 }
|
||||||
local highlight = config.highlight or { 180, 180, 255 }
|
local highlight = config.highlight or { 0x19, 0xAE, 0xFF }
|
||||||
|
|
||||||
return {
|
return {
|
||||||
button = {
|
button = {
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 505 B After Width: | Height: | Size: 471 B |
Binary file not shown.
|
Before Width: | Height: | Size: 551 B After Width: | Height: | Size: 485 B |
@@ -38,6 +38,8 @@ return function (self)
|
|||||||
|
|
||||||
local function press (event)
|
local function press (event)
|
||||||
local x1, y1, x2, y2 = self:getRectangle(true, true)
|
local x1, y1, x2, y2 = self:getRectangle(true, true)
|
||||||
|
local halfThumb = thumb:getWidth() / 2
|
||||||
|
x1, x2 = x1 + halfThumb, x2 - halfThumb
|
||||||
self:setValue(clamp((event.x - x1) / (x2 - x1)))
|
self:setValue(clamp((event.x - x1) / (x2 - x1)))
|
||||||
self:reshape()
|
self:reshape()
|
||||||
self.layout:tryFocus(thumb)
|
self.layout:tryFocus(thumb)
|
||||||
@@ -56,6 +58,8 @@ return function (self)
|
|||||||
|
|
||||||
self:onReshape(function (event)
|
self:onReshape(function (event)
|
||||||
local x1, y1, x2, y2 = self:getRectangle(true, true)
|
local x1, y1, x2, y2 = self:getRectangle(true, true)
|
||||||
spacer.width = self.value * (x2 - x1 - thumb:getWidth())
|
local halfThumb = thumb:getWidth() / 2
|
||||||
|
x1, x2 = x1 + halfThumb, x2 - halfThumb
|
||||||
|
spacer.width = self.value * (x2 - x1)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user