1
0
Fork 0
mirror of https://github.com/borgbase/vorta synced 2024-12-22 07:43:09 +00:00

Fix dynamic colouring.

Fixes the paste icon so that vorta can invert the its colour. Fixes #1556.
Updates icons in main window and source tab correctly when the colour palette changes.

* src/vorta/assets/icons/paste.svg : Remove fill of `path` item.

* src/vorta/views/source_tab.py : Connect `QApplication.paletteChange` to `set_icons`.
* src/vorta/views/main_window.py
This commit is contained in:
real-yfprojects 2023-01-21 08:21:56 +01:00
parent c620c0d9ac
commit a6f75775ed
No known key found for this signature in database
GPG key ID: 00F630DFDEE25747
3 changed files with 13 additions and 2 deletions

View file

@ -1 +1,6 @@
<svg aria-hidden="true" fill="#00000" focusable="false" data-prefix="fas" data-icon="paste" class="svg-inline--fa fa-paste" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M320 96V80C320 53.49 298.5 32 272 32H215.4C204.3 12.89 183.6 0 160 0S115.7 12.89 104.6 32H48C21.49 32 0 53.49 0 80v320C0 426.5 21.49 448 48 448l144 .0013L192 176C192 131.8 227.8 96 272 96H320zM160 88C146.8 88 136 77.25 136 64S146.8 40 160 40S184 50.75 184 64S173.3 88 160 88zM416 128v96h96L416 128zM384 224L384 128h-112C245.5 128 224 149.5 224 176v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48V256h-95.99C398.4 256 384 241.6 384 224z"></path></svg>
<svg aria-hidden="true" fill="#000000" focusable="false" data-prefix="fas" data-icon="paste"
class="svg-inline--fa fa-paste" role="img" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512">
<path
d="M320 96V80C320 53.49 298.5 32 272 32H215.4C204.3 12.89 183.6 0 160 0S115.7 12.89 104.6 32H48C21.49 32 0 53.49 0 80v320C0 426.5 21.49 448 48 448l144 .0013L192 176C192 131.8 227.8 96 272 96H320zM160 88C146.8 88 136 77.25 136 64S146.8 40 160 40S184 50.75 184 64S173.3 88 160 88zM416 128v96h96L416 128zM384 224L384 128h-112C245.5 128 224 149.5 224 176v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48V256h-95.99C398.4 256 384 241.6 384 224z"></path>
</svg>

Before

Width:  |  Height:  |  Size: 678 B

After

Width:  |  Height:  |  Size: 681 B

View file

@ -3,7 +3,7 @@
from PyQt5 import QtCore, uic
from PyQt5.QtCore import QPoint
from PyQt5.QtGui import QFontMetrics, QKeySequence
from PyQt5.QtWidgets import QCheckBox, QFileDialog, QMenu, QMessageBox, QShortcut, QToolTip
from PyQt5.QtWidgets import QApplication, QCheckBox, QFileDialog, QMenu, QMessageBox, QShortcut, QToolTip
from vorta.profile_export import ImportFailedException, ProfileExport
from vorta.store.models import BackupProfileModel, SettingsModel
from vorta.utils import borg_compat, get_asset, get_network_status_monitor, is_system_tray_available
@ -101,6 +101,9 @@ def __init__(self, parent=None):
self.createStartBtn.start()
self.cancelButton.setEnabled(True)
# Connect to palette change
QApplication.instance().paletteChanged.connect(lambda p: self.set_icons())
self.set_icons()
def on_close_window(self):

View file

@ -85,6 +85,9 @@ def __init__(self, parent=None):
self.excludePatternsField.textChanged.connect(self.save_exclude_patterns)
self.excludeIfPresentField.textChanged.connect(self.save_exclude_if_present)
# Connect to palette change
QApplication.instance().paletteChanged.connect(lambda p: self.set_icons())
# Populate
self.populate_from_profile()
self.set_icons()