mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
fix to redraw and improvements to hide()
This commit is contained in:
parent
3a5d69d96f
commit
4d4dd4ed39
@ -775,11 +775,14 @@ function element.new(args, child_offset_x, child_offset_y)
|
|||||||
|
|
||||||
-- hide the element and disables animations<br>
|
-- hide the element and disables animations<br>
|
||||||
-- this alone does not cause an element to be fully hidden, it only prevents updates from being shown<br>
|
-- this alone does not cause an element to be fully hidden, it only prevents updates from being shown<br>
|
||||||
|
---@see graphics_element.redraw
|
||||||
---@see graphics_element.content_redraw
|
---@see graphics_element.content_redraw
|
||||||
function public.hide()
|
---@param clear? boolean true to visibly hide this element (redraws the parent)
|
||||||
|
function public.hide(clear)
|
||||||
public.freeze_all() -- stop animations for efficiency/performance
|
public.freeze_all() -- stop animations for efficiency/performance
|
||||||
public.unfocus_all()
|
public.unfocus_all()
|
||||||
protected.window.setVisible(false)
|
protected.window.setVisible(false)
|
||||||
|
if clear and args.parent then args.parent.redraw() end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- start/resume animation(s)
|
-- start/resume animation(s)
|
||||||
@ -803,8 +806,14 @@ function element.new(args, child_offset_x, child_offset_y)
|
|||||||
for _, child in pairs(protected.children) do child.get().freeze_all() end
|
for _, child in pairs(protected.children) do child.get().freeze_all() end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- re-draw the element
|
-- re-draw this element and all its children
|
||||||
function public.redraw() protected.window.redraw() end
|
function public.redraw()
|
||||||
|
protected.window.setBackgroundColor(protected.fg_bg.bkg)
|
||||||
|
protected.window.setTextColor(protected.fg_bg.fgd)
|
||||||
|
protected.window.clear()
|
||||||
|
protected.redraw()
|
||||||
|
for _, child in pairs(protected.children) do child.get().redraw() end
|
||||||
|
end
|
||||||
|
|
||||||
-- if a content window is set, clears it then re-draws all children
|
-- if a content window is set, clears it then re-draws all children
|
||||||
function public.content_redraw()
|
function public.content_redraw()
|
||||||
|
Loading…
Reference in New Issue
Block a user