Widget.pressed is now a table of booleans keyed by mouse button name

This commit is contained in:
airstruck
2015-12-20 01:13:43 -05:00
parent 1ee239b203
commit 73e9a10b15
5 changed files with 13 additions and 14 deletions

View File

@@ -36,14 +36,14 @@ return function (config)
local text = resources .. 'text.png'
local function getButtonSlices (self)
return self.pressed and button_pressed
return self.pressed.left and button_pressed
or self.focused and button_focused
or self.hovered and button_hovered
or button
end
local function getCheckIcon (self)
if self.pressed then
if self.pressed.left then
return self.value and check_checked_pressed
or check_unchecked_pressed
end
@@ -67,7 +67,7 @@ return function (config)
end
local function getRadioIcon (self)
if self.pressed then
if self.pressed.left then
return self.value and radio_checked_pressed
or radio_unchecked_pressed
end