1
0
Fork 0
mirror of synced 2024-06-29 11:40:37 +12:00
Rare/rare/components/tray_icon.py
Stelios Tsampas e8dadb6b00 Update the RareStyle to handle radiobutton, disabled widgets, etc.
* Add RareStyle qrc with the icons needed for comboboxes and spinboxes
* Add images as svg
* Refactor `styles` to `resources` since it contains more things now.
* Add stylesheet folders, each folder must contain a `stylesheet.qss` file.
* Don't use QResources, instead add an identifier in the qss url() which can
  replaced later with the full path.
* Update RareStyle with SVG images for better quality.
2021-06-24 20:08:04 +03:00

26 lines
679 B
Python

import os
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QSystemTrayIcon, QMenu, QAction
from rare import resources_path
class TrayIcon(QSystemTrayIcon):
def __init__(self, parent):
super(TrayIcon, self).__init__(parent)
self.setIcon(QIcon(os.path.join(resources_path, "images", "Rare.png")))
self.setVisible(True)
self.setToolTip("Rare")
self.menu = QMenu()
self.start_rare = QAction("Rare")
self.menu.addAction(self.start_rare)
self.exit_action = QAction(self.tr("Exit"))
self.menu.addSeparator()
self.menu.addAction(self.exit_action)
self.setContextMenu(self.menu)