Made the super menu togglable
This commit is contained in:
14
main.py
14
main.py
@@ -319,7 +319,7 @@ class WebSearchResults(QtWidgets.QDialog):
|
|||||||
class MainWindow(QtWidgets.QMainWindow):
|
class MainWindow(QtWidgets.QMainWindow):
|
||||||
show_menu_signal = QtCore.Signal()
|
show_menu_signal = QtCore.Signal()
|
||||||
|
|
||||||
def __init__(self, restart=False, no_quit=False):
|
def __init__(self, restart=False, no_quit=False, super_menu=True):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
flags = (
|
flags = (
|
||||||
@@ -343,6 +343,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
mask = QtGui.QBitmap.fromImage(mask_img)
|
mask = QtGui.QBitmap.fromImage(mask_img)
|
||||||
self.setMask(mask)
|
self.setMask(mask)
|
||||||
|
|
||||||
|
self.super_menu = super_menu
|
||||||
|
|
||||||
self.tray = QtWidgets.QSystemTrayIcon(self)
|
self.tray = QtWidgets.QSystemTrayIcon(self)
|
||||||
self.tray.setIcon(QtGui.QIcon(str(ASSET)))
|
self.tray.setIcon(QtGui.QIcon(str(ASSET)))
|
||||||
|
|
||||||
@@ -381,8 +383,9 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
self.left_menu.popup(QtGui.QCursor.pos())
|
self.left_menu.popup(QtGui.QCursor.pos())
|
||||||
|
|
||||||
def on_press(self, key):
|
def on_press(self, key):
|
||||||
if key == keyboard.Key.cmd:
|
if self.super_menu:
|
||||||
self.show_menu_signal.emit()
|
if key == keyboard.Key.cmd:
|
||||||
|
self.show_menu_signal.emit()
|
||||||
|
|
||||||
def start_hotkey_listener(self):
|
def start_hotkey_listener(self):
|
||||||
self.listener = keyboard.Listener(on_press=self.on_press)
|
self.listener = keyboard.Listener(on_press=self.on_press)
|
||||||
@@ -499,9 +502,10 @@ def main():
|
|||||||
app = QtWidgets.QApplication(sys.argv)
|
app = QtWidgets.QApplication(sys.argv)
|
||||||
app.setApplicationName("CLARA")
|
app.setApplicationName("CLARA")
|
||||||
|
|
||||||
restart_enabled = "--restart" in sys.argv
|
restart = "--restart" in sys.argv
|
||||||
no_quit = "--no-quit" in sys.argv
|
no_quit = "--no-quit" in sys.argv
|
||||||
pet = MainWindow(restart=restart_enabled, no_quit=no_quit)
|
super_menu = not "--no-super" in sys.argv
|
||||||
|
pet = MainWindow(restart=restart, no_quit=no_quit, super_menu=super_menu)
|
||||||
presence.start()
|
presence.start()
|
||||||
|
|
||||||
# bottom right corner
|
# bottom right corner
|
||||||
|
|||||||
Reference in New Issue
Block a user