eric6/Plugins/UiExtensionPlugins/Translator/Translator.py

changeset 7505
7d3cfeeb5f4f
parent 7360
9190402e4505
child 7513
d8354f4d3dc7
--- a/eric6/Plugins/UiExtensionPlugins/Translator/Translator.py	Sun Apr 05 12:00:11 2020 +0200
+++ b/eric6/Plugins/UiExtensionPlugins/Translator/Translator.py	Sun Apr 05 16:19:12 2020 +0200
@@ -22,7 +22,7 @@
     """
     Class implementing the translator object.
     """
-    def __init__(self, plugin, parent=None):
+    def __init__(self, plugin, usesDarkPalette, parent=None):
         """
         Constructor
         
@@ -35,6 +35,11 @@
         self.__ui = parent
         
         self.__widget = None
+        
+        if usesDarkPalette:
+            self.__iconSuffix = "dark"
+        else:
+            self.__iconSuffix = "light"
     
     def activate(self):
         """
@@ -46,7 +51,8 @@
         self.__ui.addSideWidget(
             self.__ui.BottomSide, self.__widget,
             UI.PixmapCache.getIcon(
-                os.path.join(os.path.dirname(__file__), "icons", "flag.png")),
+                os.path.join(os.path.dirname(__file__), "icons",
+                             "flag-{0}".format(self.__iconSuffix))),
             self.tr("Translator"))
         
         self.__activateAct = E5Action(
@@ -85,7 +91,9 @@
         @return icon (QIcon)
         """
         return UI.PixmapCache.getIcon(os.path.join(
-            os.path.dirname(__file__), "icons", name))
+            os.path.dirname(__file__), "icons",
+           "{0}-{1}".format(name, self.__iconSuffix)
+        ))
     
     def __activateWidget(self):
         """

eric ide

mercurial