bug(w.l.overflow): Fix resetting the widget

This commit is contained in:
Lucas Schwiderski 2022-10-31 16:22:54 +01:00
parent 29cfdc1a0a
commit d4a2fb06b0
No known key found for this signature in database
GPG Key ID: AA12679AAA6DF4D8
1 changed files with 14 additions and 0 deletions

View File

@ -476,6 +476,20 @@ function overflow:get_scrollbar_widget()
return self._private.scrollbar_widget return self._private.scrollbar_widget
end end
function overflow:reset()
self._private.widgets = {}
self._private.scroll_factor = 0
local scrollbar_widget = separator({ shape = gshape.rectangle })
apply_scrollbar_mouse_signal(self, scrollbar_widget)
self._private.scrollbar_widget = scrollbar_widget
self:emit_signal("widget::layout_changed")
self:emit_signal("widget::reset")
self:emit_signal("widget::reseted")
end
local function new(dir, ...) local function new(dir, ...)
local ret = fixed[dir](...) local ret = fixed[dir](...)