graph and progressbar: Convert to new system
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
0aa4304bda
commit
26699d5ad7
|
@ -195,7 +195,7 @@ local function add_value(_graph, value, group)
|
||||||
table.remove(values, 1)
|
table.remove(values, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
_graph:emit_signal("widget::updated")
|
_graph:emit_signal("widget::redraw_needed")
|
||||||
return _graph
|
return _graph
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ end
|
||||||
function graph:set_height(height)
|
function graph:set_height(height)
|
||||||
if height >= 5 then
|
if height >= 5 then
|
||||||
data[self].height = height
|
data[self].height = height
|
||||||
self:emit_signal("widget::updated")
|
self:emit_signal("widget::layout_changed")
|
||||||
end
|
end
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
@ -215,7 +215,7 @@ end
|
||||||
function graph:set_width(width)
|
function graph:set_width(width)
|
||||||
if width >= 5 then
|
if width >= 5 then
|
||||||
data[self].width = width
|
data[self].width = width
|
||||||
self:emit_signal("widget::updated")
|
self:emit_signal("widget::layout_changed")
|
||||||
end
|
end
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
@ -226,7 +226,7 @@ for _, prop in ipairs(properties) do
|
||||||
graph["set_" .. prop] = function(_graph, value)
|
graph["set_" .. prop] = function(_graph, value)
|
||||||
if data[_graph][prop] ~= value then
|
if data[_graph][prop] ~= value then
|
||||||
data[_graph][prop] = value
|
data[_graph][prop] = value
|
||||||
_graph:emit_signal("widget::updated")
|
_graph:emit_signal("widget::redraw_needed")
|
||||||
end
|
end
|
||||||
return _graph
|
return _graph
|
||||||
end
|
end
|
||||||
|
|
|
@ -164,7 +164,7 @@ function progressbar:set_value(value)
|
||||||
local value = value or 0
|
local value = value or 0
|
||||||
local max_value = data[self].max_value
|
local max_value = data[self].max_value
|
||||||
data[self].value = math.min(max_value, math.max(0, value))
|
data[self].value = math.min(max_value, math.max(0, value))
|
||||||
self:emit_signal("widget::updated")
|
self:emit_signal("widget::redraw_needed")
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ end
|
||||||
-- @param height The height to set.
|
-- @param height The height to set.
|
||||||
function progressbar:set_height(height)
|
function progressbar:set_height(height)
|
||||||
data[self].height = height
|
data[self].height = height
|
||||||
self:emit_signal("widget::updated")
|
self:emit_signal("widget::layout_changed")
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ end
|
||||||
-- @param width The width to set.
|
-- @param width The width to set.
|
||||||
function progressbar:set_width(width)
|
function progressbar:set_width(width)
|
||||||
data[self].width = width
|
data[self].width = width
|
||||||
self:emit_signal("widget::updated")
|
self:emit_signal("widget::layout_changed")
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ for _, prop in ipairs(properties) do
|
||||||
if not progressbar["set_" .. prop] then
|
if not progressbar["set_" .. prop] then
|
||||||
progressbar["set_" .. prop] = function(pbar, value)
|
progressbar["set_" .. prop] = function(pbar, value)
|
||||||
data[pbar][prop] = value
|
data[pbar][prop] = value
|
||||||
pbar:emit_signal("widget::updated")
|
pbar:emit_signal("widget::redraw_needed")
|
||||||
return pbar
|
return pbar
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue