Skip to content

Commit

Permalink
Merge pull request #19 from yakimka/actions_in_tray
Browse files Browse the repository at this point in the history
Add Settings and About actions in tray icon context menu
  • Loading branch information
yakimka authored Sep 30, 2020
2 parents ec7cd1d + ea358d1 commit f63ec6e
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 f63ec6e

Please sign in to comment.