#405 #340 reactor plc configurator control of theme and color mode

This commit is contained in:
Mikayla Fischler
2024-03-07 18:00:33 -05:00
parent 510995b04f
commit 48a8eadc55
8 changed files with 186 additions and 29 deletions

View File

@@ -28,16 +28,16 @@ local ALIGN = core.ALIGN
local cpair = core.cpair
local border = core.border
local s_hi_box = style.theme.highlight_box
local disabled_fg = style.fp.disabled_fg
local ind_grn = style.ind_grn
local ind_red = style.ind_red
-- create new front panel view
---@param panel graphics_element main displaybox
local function init(panel)
local s_hi_box = style.theme.highlight_box
local disabled_fg = style.fp.disabled_fg
local header = TextBox{parent=panel,y=1,text="FISSION REACTOR PLC - UNIT ?",alignment=ALIGN.CENTER,height=1,fg_bg=style.theme.header}
header.register(databus.ps, "unit_id", function (id) header.set_value(util.c("FISSION REACTOR PLC - UNIT ", id)) end)

View File

@@ -10,10 +10,22 @@ local style = {}
local cpair = core.cpair
style.theme = themes.basalt
style.theme = themes.sandstone
style.fp = themes.get_fp_style(style.theme)
style.ind_grn = cpair(colors.green, colors.green_off)
style.ind_red = cpair(colors.red, colors.red_off)
-- set theme per configuration
---@param fp integer fp theme ID (1 = sandstone, 2 = basalt)
function style.set_theme(fp)
if fp == 1 then
style.theme = themes.sandstone
elseif fp == 2 then
style.theme = themes.basalt
end
style.fp = themes.get_fp_style(style.theme)
end
return style