PluginSelectionEncloser.py

changeset 39
401d0bab970d
parent 38
f9f7c3af2f18
child 41
e747eb5f3f43
equal deleted inserted replaced
38:f9f7c3af2f18 39:401d0bab970d
22 # Start-Of-Header 22 # Start-Of-Header
23 name = "Selection Encloser Plug-in" 23 name = "Selection Encloser Plug-in"
24 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 24 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
25 autoactivate = True 25 autoactivate = True
26 deactivateable = True 26 deactivateable = True
27 version = "2.1.4" 27 version = "2.2.0"
28 className = "SelectionEncloserPlugin" 28 className = "SelectionEncloserPlugin"
29 packageName = "SelectionEncloser" 29 packageName = "SelectionEncloser"
30 shortDescription = "Enclose the selection with a string." 30 shortDescription = "Enclose the selection with a string."
31 longDescription = \ 31 longDescription = \
32 """This plug-in implements a tool to enclose the selection of""" \ 32 """This plug-in implements a tool to enclose the selection of""" \
60 """ 60 """
61 Module function returning data as required by the configuration dialog. 61 Module function returning data as required by the configuration dialog.
62 62
63 @return dictionary containing the relevant data 63 @return dictionary containing the relevant data
64 """ 64 """
65 try:
66 usesDarkPalette = e5App().usesDarkPalette()
67 except AttributeError:
68 from PyQt5.QtGui import QPalette
69 palette = e5App().palette()
70 lightness = palette.color(QPalette.Window).lightness()
71 usesDarkPalette = lightness <= 128
72 if usesDarkPalette:
73 iconSuffix = "dark"
74 else:
75 iconSuffix = "light"
76
65 return { 77 return {
66 "selectionEncloserPage": [ 78 "selectionEncloserPage": [
67 QCoreApplication.translate("SelectionEncloserPlugin", 79 QCoreApplication.translate("SelectionEncloserPlugin",
68 "Selection Encloser"), 80 "Selection Encloser"),
69 os.path.join("SelectionEncloser", "icons", 81 os.path.join("SelectionEncloser", "icons",
70 "selectionEncloser.png"), 82 "selectionEncloser-{0}".format(iconSuffix)),
71 createSelectionEncloserPage, None, None], 83 createSelectionEncloserPage, None, None],
72 } 84 }
73 85
74 86
75 def prepareUninstall(): 87 def prepareUninstall():

eric ide

mercurial