Allow adjusting the font size of tk popups

This commit is contained in:
Pavle Portic 2023-06-15 19:41:34 +02:00
parent d03e6307f5
commit 37b5646d65
No known key found for this signature in database
GPG key ID: 66AD4BA646FBC0D2
8 changed files with 28 additions and 20 deletions

View file

@ -75,19 +75,15 @@ class Module(core.module.Module):
def popup(self, widget):
"""Show a popup menu."""
menu = util.popup.PopupMenu()
menu = util.popup.menu(self.__config)
if self._status == "On":
menu.add_menuitem("Disable Bluetooth")
menu.add_menuitem("Disable Bluetooth", callback=self._toggle)
elif self._status == "Off":
menu.add_menuitem("Enable Bluetooth")
menu.add_menuitem("Enable Bluetooth", callback=self._toggle)
else:
return
# show menu and get return code
ret = menu.show(widget)
if ret == 0:
# first (and only) item selected.
self._toggle()
menu.show(widget)
def _toggle(self, widget=None):
"""Toggle bluetooth state."""