[modules/rotation] fix widget creation

each iteration of the rotation module created new/duplicate widgets,
causing a status bar of infinite length.

fixes #782
This commit is contained in:
tobi-wan-kenobi 2021-04-03 19:29:40 +00:00
parent 0410ac9c6b
commit 4a6be622a8

View file

@ -31,14 +31,13 @@ class Module(core.module.Module):
orientation = curr_orient
break
widget = self.widget(display)
widget = self.widget(name=display)
if not widget:
widget = self.add_widget(full_text=display, name=display)
core.input.register(
widget, button=core.input.LEFT_MOUSE, cmd=self.__toggle
)
widget.set("orientation", orientation)
widgets.append(widget)
def state(self, widget):
return widget.get("orientation", "normal")