Make Horus widgets 'shadow' effect an option (#5203)

* Add shadows to c++ widgets

* Add BOOL zone option to Horus LUA

* LUA widgets too
This commit is contained in:
3djc
2017-09-11 07:34:49 +02:00
committed by Bertrand Songis
parent 093034f9e7
commit da71f4cbbc
5 changed files with 47 additions and 27 deletions
+7 -2
View File
@@ -17,7 +17,8 @@
local options = {
{ "Option1", SOURCE, 1 },
{ "Option2", VALUE, 1000 },
{ "Option3", COLOR, RED }
{ "Option3", COLOR, RED },
{ "Shadow", BOOL, 0 }
}
local function create(zone, options)
@@ -36,7 +37,11 @@ end
function refresh(pie)
pie.counter = pie.counter + 1
lcd.drawNumber(pie.zone.x, pie.zone.y, pie.counter, LEFT + DBLSIZE + TEXT_COLOR);
if pie.options.Shadow == 1 then
lcd.drawNumber(pie.zone.x, pie.zone.y, pie.counter, LEFT + DBLSIZE + TEXT_COLOR);
else
lcd.drawNumber(pie.zone.x, pie.zone.y, pie.counter, LEFT + DBLSIZE + TEXT_COLOR + SHADOWED);
end
end
return { name="Counter", options=options, create=create, update=update, refresh=refresh, background=background }