From 5f2857ad9aa3d090b6894be0b3d9a1cde96dee60 Mon Sep 17 00:00:00 2001 From: Naya Verdier Date: Sat, 25 Jul 2020 08:46:57 -0700 Subject: [PATCH] [vault] add leave_menu parameter to auto-close the menu --- bumblebee_status/modules/core/vault.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bumblebee_status/modules/core/vault.py b/bumblebee_status/modules/core/vault.py index 28f37f4..ee4fc7f 100644 --- a/bumblebee_status/modules/core/vault.py +++ b/bumblebee_status/modules/core/vault.py @@ -12,6 +12,8 @@ Parameters: * vault.location: Location of the password store (defaults to ~/.password-store) * vault.offx: x-axis offset of popup menu (defaults to 0) * vault.offy: y-axis offset of popup menu (defaults to 0) + * vault.leave_menu: Boolean flag to close menu when the mouse leaves (defaults to False) + * vault.text: Text to display on the widget (defaults to ) Many thanks to `bbernhard `_ for the idea! """ @@ -72,7 +74,7 @@ class Module(core.module.Module): core.input.register(self, button=core.input.LEFT_MOUSE, cmd=self.popup) def popup(self, widget): - menu = util.popup.menu(leave=False) + menu = util.popup.menu(leave=util.format.asbool(self.parameter("leave_menu", False))) build_menu(menu, self.__path, self.__callback) menu.show(widget, offset_x=self.__offx, offset_y=self.__offy)