e8dadb6b00
* 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.
25 lines
679 B
Python
25 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)
|