File: 0003-Look-for-style.qss-in-two-places-to-help-with-testin.patch

package info (click to toggle)
napari-plugin-manager 0.1.4-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,928 kB
  • sloc: python: 3,055; makefile: 46
file content (31 lines) | stat: -rw-r--r-- 1,319 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From: Roland Mas <roland.mas@entierement.net>
Date: Fri, 9 May 2025 00:13:25 +0200
Subject: Look for style.qss in two places to help with testing

---
 napari_plugin_manager/qt_plugin_dialog.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/napari_plugin_manager/qt_plugin_dialog.py b/napari_plugin_manager/qt_plugin_dialog.py
index 43d1821..ac2fe47 100644
--- a/napari_plugin_manager/qt_plugin_dialog.py
+++ b/napari_plugin_manager/qt_plugin_dialog.py
@@ -39,7 +39,8 @@ from napari_plugin_manager.qt_package_installer import NapariInstallerQueue
 from napari_plugin_manager.utils import is_conda_package
 
 # Scaling factor for each list widget item when expanding.
-STYLES_PATH = Path(__file__).parent / 'styles.qss'
+STYLES_PATHS = [ Path(__file__).parent / 'styles.qss',
+                 Path(__file__).parent.parent / 'styles.qss' ]
 DISMISS_WARN_PYPI_INSTALL_DLG = False
 
 
@@ -202,7 +203,7 @@ class QtPluginDialog(BaseQtPluginDialog):
         get_settings().appearance.events.theme.connect(self._update_theme)
 
     def _update_theme(self, event):
-        stylesheet = get_current_stylesheet([STYLES_PATH])
+        stylesheet = get_current_stylesheet([p for p in STYLES_PATHS if p.exists()])
         self.setStyleSheet(stylesheet)
 
     def _add_installed(self, pkg_name=None):