custom tray icons

This commit is contained in:
Vinicius Moreira
2019-10-10 10:56:41 -03:00
parent a5d6d0c957
commit 64a23a11be
4 changed files with 7 additions and 2 deletions

View File

@@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- AUR:
- Optional dependencies are not checked by default in their installation popup.
- History panel can now me maximized, minimized and allows to copy column content.
- It is possible to use custom tray icons via the environment variables: **BAUH_TRAY_DEFAULT_ICON_PATH** and ** **BAUH_TRAY_UPDATES_ICON_PATH** ( displayed when there are updates )
- Minor UI improvements
### Fixes

View File

@@ -82,6 +82,8 @@ You can change some application settings via environment variables or arguments
- **BAUH_MAX_DISPLAYED**: Maximum number of displayed packages in the management panel table. Default: 50.
- **BAUH_LOGS**: enable **bauh** logs (for debugging purposes). Use: **0** (disable, default) or **1** (enable)
- **BAUH_DOWNLOAD_MULTITHREAD**: enable multi-threaded download for installation files ( only possible if **aria2** is installed ). This feature reduces applications installation time ( only supported by AUR packages at the moment ). Use **0** (disable) or **1** (enabled, default).
- **BAUH_TRAY_DEFAULT_ICON_PATH**: define a custom icon for the tray mode ( absolute path)
- **BAUH_TRAY_UPDATES_ICON_PATH** define a custom updates icon for the tray mode ( absolute path)
### How to improve **bauh** performance
- Disable package types that you do not want to deal with ( via GUI )

View File

@@ -16,6 +16,7 @@ def is_root():
def ask_root_password(locale_keys: dict):
diag = QInputDialog()
diag.setStyleSheet("""QLineEdit { border-radius: 5px; font-size: 16px }""")
diag.setInputMode(QInputDialog.TextInput)
diag.setTextEchoMode(QLineEdit.Password)
diag.setWindowIcon(QIcon(resource.get_path('img/lock.svg')))

View File

@@ -1,3 +1,4 @@
import os
import time
from io import StringIO
from threading import Lock, Thread
@@ -39,8 +40,8 @@ class TrayIcon(QSystemTrayIcon):
self.i18n = i18n
self.manager = manager
self.icon_default = QIcon(resource.get_path('img/logo.png'))
self.icon_update = QIcon(resource.get_path('img/logo_update.png'))
self.icon_default = QIcon(os.getenv('BAUH_TRAY_DEFAULT_ICON_PATH', resource.get_path('img/logo.png')))
self.icon_update = QIcon(os.getenv('BAUH_TRAY_UPDATES_ICON_PATH', resource.get_path('img/logo_update.png')))
self.setIcon(self.icon_default)
self.menu = QMenu()