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."""

View file

@ -8,11 +8,11 @@ adds the possibility to
* reboot
the system.
Per default a confirmation dialog is shown before the actual action is performed.
Parameters:
* system.confirm: show confirmation dialog before performing any action (default: true)
* system.confirm: show confirmation dialog before performing any action (default: true)
* system.reboot: specify a reboot command (defaults to 'reboot')
* system.shutdown: specify a shutdown command (defaults to 'shutdown -h now')
* system.logout: specify a logout command (defaults to 'i3exit logout')
@ -77,7 +77,7 @@ class Module(core.module.Module):
util.cli.execute(popupcmd)
return
menu = util.popup.menu()
menu = util.popup.menu(self.__config)
reboot_cmd = self.parameter("reboot", "reboot")
shutdown_cmd = self.parameter("shutdown", "shutdown -h now")
logout_cmd = self.parameter("logout", "i3exit logout")

View file

@ -93,7 +93,7 @@ class Module(core.module.Module):
self.__connected_vpn_profile = None
def popup(self, widget):
menu = util.popup.menu()
menu = util.popup.menu(self.__config)
if self.__connected_vpn_profile is not None:
menu.add_menuitem("Disconnect", callback=self.__on_vpndisconnect)