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)
|
||||
end
|
||||
|
||||
_graph:emit_signal("widget::updated")
|
||||
_graph:emit_signal("widget::redraw_needed")
|
||||
return _graph
|
||||
end
|
||||
|
||||
|
@ -205,7 +205,7 @@ end
|
|||
function graph:set_height(height)
|
||||
if height >= 5 then
|
||||
data[self].height = height
|
||||
self:emit_signal("widget::updated")
|
||||
self:emit_signal("widget::layout_changed")
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
@ -215,7 +215,7 @@ end
|
|||
function graph:set_width(width)
|
||||
if width >= 5 then
|
||||
data[self].width = width
|
||||
self:emit_signal("widget::updated")
|
||||
self:emit_signal("widget::layout_changed")
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
@ -226,7 +226,7 @@ for _, prop in ipairs(properties) do
|
|||
graph["set_" .. prop] = function(_graph, value)
|
||||
if data[_graph][prop] ~= value then
|
||||
data[_graph][prop] = value
|
||||
_graph:emit_signal("widget::updated")
|
||||
_graph:emit_signal("widget::redraw_needed")
|
||||
end
|
||||
return _graph
|
||||
end
|
||||
|
|
|
@ -164,7 +164,7 @@ function progressbar:set_value(value)
|
|||
local value = value or 0
|
||||
local max_value = data[self].max_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
|
||||
end
|
||||
|
||||
|
@ -172,7 +172,7 @@ end
|
|||
-- @param height The height to set.
|
||||
function progressbar:set_height(height)
|
||||
data[self].height = height
|
||||
self:emit_signal("widget::updated")
|
||||
self:emit_signal("widget::layout_changed")
|
||||
return self
|
||||
end
|
||||
|
||||
|
@ -180,7 +180,7 @@ end
|
|||
-- @param width The width to set.
|
||||
function progressbar:set_width(width)
|
||||
data[self].width = width
|
||||
self:emit_signal("widget::updated")
|
||||
self:emit_signal("widget::layout_changed")
|
||||
return self
|
||||
end
|
||||
|
||||
|
@ -189,7 +189,7 @@ for _, prop in ipairs(properties) do
|
|||
if not progressbar["set_" .. prop] then
|
||||
progressbar["set_" .. prop] = function(pbar, value)
|
||||
data[pbar][prop] = value
|
||||
pbar:emit_signal("widget::updated")
|
||||
pbar:emit_signal("widget::redraw_needed")
|
||||
return pbar
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue