Made the super menu togglable
This commit is contained in:
10
main.py
10
main.py
@@ -319,7 +319,7 @@ class WebSearchResults(QtWidgets.QDialog):
|
||||
class MainWindow(QtWidgets.QMainWindow):
|
||||
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__()
|
||||
|
||||
flags = (
|
||||
@@ -343,6 +343,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
mask = QtGui.QBitmap.fromImage(mask_img)
|
||||
self.setMask(mask)
|
||||
|
||||
self.super_menu = super_menu
|
||||
|
||||
self.tray = QtWidgets.QSystemTrayIcon(self)
|
||||
self.tray.setIcon(QtGui.QIcon(str(ASSET)))
|
||||
|
||||
@@ -381,6 +383,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
self.left_menu.popup(QtGui.QCursor.pos())
|
||||
|
||||
def on_press(self, key):
|
||||
if self.super_menu:
|
||||
if key == keyboard.Key.cmd:
|
||||
self.show_menu_signal.emit()
|
||||
|
||||
@@ -499,9 +502,10 @@ def main():
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
app.setApplicationName("CLARA")
|
||||
|
||||
restart_enabled = "--restart" in sys.argv
|
||||
restart = "--restart" 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()
|
||||
|
||||
# bottom right corner
|
||||
|
||||
Reference in New Issue
Block a user