Skip to content

Commit

Permalink
Add Settings and About actions in tray icon context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
yakimka committed Sep 30, 2020
1 parent ec7cd1d commit ea358d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions CherryTomato/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ def setTrayIcon(app, mainWindow):
trayIcon = QSystemTrayIcon(parent=app, icon=icon)

menu = QMenu(parent=mainWindow)

settingsAction = QAction(text='Settings', parent=menu)
settingsAction.triggered.connect(mainWindow.showSettingsWindow)
menu.addAction(settingsAction)

aboutAction = QAction(text='About', parent=menu)
aboutAction.triggered.connect(mainWindow.showAboutWindow)
menu.addAction(aboutAction)

quitAction = QAction(text='Quit', parent=menu)
quitAction.triggered.connect(app.quit)
menu.addAction(quitAction)
Expand Down
2 changes: 1 addition & 1 deletion CherryTomato/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def setColor(self, base: tuple, highlight: tuple):
self.progress.setPalette(palette)
self.button.setColor(highlight)

@Qt.pyqtSlot(name='setFocusOnWindowAndPlayNotification')
@Qt.pyqtSlot(name='setFocusOnWindow')
def setFocusOnWindow(self):
self.show()
self.activateWindow()
Expand Down

0 comments on commit ea358d1

Please sign in to comment.