mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-09 02:54:16 +02:00
[fix] default tray icons are not displayed in KDE
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtGui import QIcon, QPixmap
|
||||
|
||||
from bauh.view.util import resource
|
||||
|
||||
|
||||
def load_icon(path: str, width: int, height: int = None) -> QIcon:
|
||||
return QIcon(QPixmap(path).scaled(width, height if height else width, Qt.KeepAspectRatio, Qt.SmoothTransformation))
|
||||
|
||||
|
||||
def load_resource_icon(path: str, width: int, height: int = None) -> QIcon:
|
||||
return load_icon(resource.get_path(path), width, height)
|
||||
|
||||
def load_icon(path: str, size: int) -> QIcon:
|
||||
pixmap = QPixmap(path)
|
||||
return QIcon(pixmap.scaled(size, size, Qt.KeepAspectRatio, Qt.SmoothTransformation))
|
||||
|
||||
Reference in New Issue
Block a user