mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
#63 bugfixes
This commit is contained in:
parent
0950fc045d
commit
3004902ce5
@ -29,9 +29,11 @@ local function push_button(args)
|
|||||||
|
|
||||||
-- write the button text
|
-- write the button text
|
||||||
e.window.setCursorPos(h_pad, v_pad)
|
e.window.setCursorPos(h_pad, v_pad)
|
||||||
e.write(args.text)
|
e.window.write(args.text)
|
||||||
|
|
||||||
-- handle touch
|
-- handle touch
|
||||||
|
---@param event monitor_touch monitor touch event
|
||||||
|
---@diagnostic disable-next-line: unused-local
|
||||||
function e.handle_touch(event)
|
function e.handle_touch(event)
|
||||||
if args.active_fg_bg ~= nil then
|
if args.active_fg_bg ~= nil then
|
||||||
-- show as pressed
|
-- show as pressed
|
||||||
|
@ -32,7 +32,7 @@ local function switch_button(args)
|
|||||||
|
|
||||||
-- write the button text
|
-- write the button text
|
||||||
e.window.setCursorPos(h_pad, v_pad)
|
e.window.setCursorPos(h_pad, v_pad)
|
||||||
e.write(args.text)
|
e.window.write(args.text)
|
||||||
|
|
||||||
-- show the button state
|
-- show the button state
|
||||||
local function draw_state()
|
local function draw_state()
|
||||||
@ -53,6 +53,8 @@ local function switch_button(args)
|
|||||||
draw_state()
|
draw_state()
|
||||||
|
|
||||||
-- handle touch
|
-- handle touch
|
||||||
|
---@param event monitor_touch monitor touch event
|
||||||
|
---@diagnostic disable-next-line: unused-local
|
||||||
function e.handle_touch(event)
|
function e.handle_touch(event)
|
||||||
-- toggle state
|
-- toggle state
|
||||||
state = not state
|
state = not state
|
||||||
|
@ -24,7 +24,7 @@ local function data_indicator(args)
|
|||||||
|
|
||||||
-- label color
|
-- label color
|
||||||
if args.label_unit_colors ~= nil then
|
if args.label_unit_colors ~= nil then
|
||||||
e.window.setForegroundColor(args.label_unit_colors.color_a)
|
e.window.setTextColor(args.label_unit_colors.color_a)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- write label
|
-- write label
|
||||||
@ -40,13 +40,13 @@ local function data_indicator(args)
|
|||||||
|
|
||||||
-- write data
|
-- write data
|
||||||
e.window.setCursorPos(data_start, 1)
|
e.window.setCursorPos(data_start, 1)
|
||||||
e.window.setForegroundColor(e.fg_bg.fgd)
|
e.window.setTextColor(e.fg_bg.fgd)
|
||||||
e.window.write(data_str)
|
e.window.write(data_str)
|
||||||
|
|
||||||
-- write label
|
-- write label
|
||||||
if args.unit ~= nil then
|
if args.unit ~= nil then
|
||||||
if args.label_unit_colors ~= nil then
|
if args.label_unit_colors ~= nil then
|
||||||
e.window.setForegroundColor(args.label_unit_colors.color_b)
|
e.window.setTextColor(args.label_unit_colors.color_b)
|
||||||
end
|
end
|
||||||
e.window.write(" " .. args.unit)
|
e.window.write(" " .. args.unit)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user