From d4a2fb06b0637cf4c9a39d016e460bb7e6c4be4a Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Mon, 31 Oct 2022 16:22:54 +0100 Subject: [PATCH] bug(w.l.overflow): Fix resetting the widget --- lib/wibox/layout/overflow.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/wibox/layout/overflow.lua b/lib/wibox/layout/overflow.lua index b9d9ff175..09d5b8d0c 100644 --- a/lib/wibox/layout/overflow.lua +++ b/lib/wibox/layout/overflow.lua @@ -476,6 +476,20 @@ function overflow:get_scrollbar_widget() return self._private.scrollbar_widget 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 ret = fixed[dir](...)