|
|
@ -177,6 +177,7 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
local function do_disable(args, quiet)
|
|
|
|
local function do_disable(args, quiet)
|
|
|
|
local disable_fn = function(name, db_entry)
|
|
|
|
local disable_fn = function(name, db_entry)
|
|
|
|
|
|
|
|
if db_entry.widget.always_enabled then return end
|
|
|
|
overlay_config[name].enabled = false
|
|
|
|
overlay_config[name].enabled = false
|
|
|
|
if db_entry.widget.hotspot then
|
|
|
|
if db_entry.widget.hotspot then
|
|
|
|
active_hotspot_widgets[name] = nil
|
|
|
|
active_hotspot_widgets[name] = nil
|
|
|
@ -244,7 +245,7 @@ local function load_widget(name, widget_class)
|
|
|
|
local config = overlay_config[name]
|
|
|
|
local config = overlay_config[name]
|
|
|
|
config.pos = sanitize_pos(config.pos or widget.default_pos)
|
|
|
|
config.pos = sanitize_pos(config.pos or widget.default_pos)
|
|
|
|
widget.frame = make_frame(config.pos, widget.frame)
|
|
|
|
widget.frame = make_frame(config.pos, widget.frame)
|
|
|
|
if config.enabled then
|
|
|
|
if config.enabled or widget.always_enabled then
|
|
|
|
do_enable(name, true, true)
|
|
|
|
do_enable(name, true, true)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
config.enabled = false
|
|
|
|
config.enabled = false
|
|
|
@ -461,7 +462,7 @@ end
|
|
|
|
-- OverlayWidget (base class of all overlay widgets) --
|
|
|
|
-- OverlayWidget (base class of all overlay widgets) --
|
|
|
|
-- ------------------------------------------------- --
|
|
|
|
-- ------------------------------------------------- --
|
|
|
|
|
|
|
|
|
|
|
|
OverlayWidget = defclass(OverlayWidget, widgets.Widget)
|
|
|
|
OverlayWidget = defclass(OverlayWidget, widgets.Panel)
|
|
|
|
OverlayWidget.ATTRS{
|
|
|
|
OverlayWidget.ATTRS{
|
|
|
|
name=DEFAULT_NIL, -- this is set by the framework to the widget name
|
|
|
|
name=DEFAULT_NIL, -- this is set by the framework to the widget name
|
|
|
|
default_pos={x=DEFAULT_X_POS, y=DEFAULT_Y_POS}, -- 1-based widget screen pos
|
|
|
|
default_pos={x=DEFAULT_X_POS, y=DEFAULT_Y_POS}, -- 1-based widget screen pos
|
|
|
@ -469,6 +470,7 @@ OverlayWidget.ATTRS{
|
|
|
|
hotspot=false, -- whether to call overlay_onupdate on all screens
|
|
|
|
hotspot=false, -- whether to call overlay_onupdate on all screens
|
|
|
|
viewscreens={}, -- override with associated viewscreen or list of viewscrens
|
|
|
|
viewscreens={}, -- override with associated viewscreen or list of viewscrens
|
|
|
|
overlay_onupdate_max_freq_seconds=5, -- throttle calls to overlay_onupdate
|
|
|
|
overlay_onupdate_max_freq_seconds=5, -- throttle calls to overlay_onupdate
|
|
|
|
|
|
|
|
always_enabled=false, -- for overlays that should never be disabled
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function OverlayWidget:init()
|
|
|
|
function OverlayWidget:init()
|
|
|
|