PluginProjectPyramid.py

changeset 133
8f183975895d
parent 132
c0d53fb9a0e0
child 136
5673d6bb4c2a
diff -r c0d53fb9a0e0 -r 8f183975895d PluginProjectPyramid.py
--- a/PluginProjectPyramid.py	Wed Jan 01 11:58:58 2020 +0100
+++ b/PluginProjectPyramid.py	Thu Apr 09 18:16:19 2020 +0200
@@ -28,7 +28,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "2.4.3"
+version = "2.5.0"
 className = "ProjectPyramidPlugin"
 packageName = "ProjectPyramid"
 shortDescription = "Project support for Pyramid projects."
@@ -63,10 +63,23 @@
     
     @return dictionary containing the relevant data
     """
+    try:
+        usesDarkPalette = e5App().usesDarkPalette()
+    except AttributeError:
+        from PyQt5.QtGui import QPalette
+        palette = e5App().palette()
+        lightness = palette.color(QPalette.Window).lightness()
+        usesDarkPalette = lightness <= 128
+    if usesDarkPalette:
+        iconSuffix = "dark"
+    else:
+        iconSuffix = "light"
+    
     return {
         "pyramidPage": [
             QCoreApplication.translate("ProjectPyramidPlugin", "Pyramid"),
-            os.path.join("ProjectPyramid", "icons", "pyramid.png"),
+            os.path.join("ProjectPyramid", "icons",
+                         "pyramid-{0}".format(iconSuffix)),
             createPyramidPage, None, None],
     }
 

eric ide

mercurial