[Gui] [Tux] Fix Nav Style Icons and theme recognition
This commit is contained in:
@@ -28,7 +28,7 @@ mw = Gui.getMainWindow()
|
||||
statusBar = mw.statusBar()
|
||||
p = App.ParamGet("User parameter:Tux/NavigationIndicator")
|
||||
pView = App.ParamGet("User parameter:BaseApp/Preferences/View")
|
||||
|
||||
pMWin = App.ParamGet("User parameter:BaseApp/Preferences/MainWindow")
|
||||
|
||||
try:
|
||||
_encoding = QtGui.QApplication.UnicodeUTF8
|
||||
@@ -62,6 +62,29 @@ class IndicatorButton(QtGui.QPushButton):
|
||||
if param == "NavigationStyle":
|
||||
setCurrent()
|
||||
|
||||
def mousePressEvent(self, event):
|
||||
RePopulateIcons()
|
||||
return super(IndicatorButton, self).mousePressEvent(event)
|
||||
|
||||
|
||||
def RePopulateIcons():
|
||||
curStyleSheet = pMWin.GetString("StyleSheet")
|
||||
if "dark" in curStyleSheet.lower():
|
||||
StyleSheetType = "light"
|
||||
else:
|
||||
StyleSheetType = "dark"
|
||||
|
||||
a1.setIcon(QtGui.QIcon(":/icons/NavigationBlender_" + StyleSheetType + ".svg"))
|
||||
a2.setIcon(QtGui.QIcon(":/icons/NavigationCAD_" + StyleSheetType + ".svg"))
|
||||
a3.setIcon(QtGui.QIcon(":/icons/NavigationGesture_" + StyleSheetType + ".svg"))
|
||||
a4.setIcon(QtGui.QIcon(":/icons/NavigationMayaGesture_" + StyleSheetType + ".svg"))
|
||||
a5.setIcon(QtGui.QIcon(":/icons/NavigationOpenCascade_" + StyleSheetType + ".svg"))
|
||||
a6.setIcon(QtGui.QIcon(":/icons/NavigationOpenInventor_" + StyleSheetType + ".svg"))
|
||||
a7.setIcon(QtGui.QIcon(":/icons/NavigationOpenSCAD_" + StyleSheetType + ".svg"))
|
||||
a8.setIcon(QtGui.QIcon(":/icons/NavigationRevit_" + StyleSheetType + ".svg"))
|
||||
a9.setIcon(QtGui.QIcon(":/icons/NavigationTinkerCAD_" + StyleSheetType + ".svg"))
|
||||
a10.setIcon(QtGui.QIcon(":/icons/NavigationTouchpad_" + StyleSheetType + ".svg"))
|
||||
|
||||
|
||||
def retranslateUi():
|
||||
"""Retranslate navigation indicator on language change"""
|
||||
@@ -602,65 +625,57 @@ a0.setData("Undefined ")
|
||||
a0.setObjectName("Indicator_NavigationUndefined")
|
||||
|
||||
a1 = QtGui.QAction(gStyle)
|
||||
a1.setIcon(QtGui.QIcon(":/icons/NavigationBlender_dark.svg"))
|
||||
a1.setText("Blender ")
|
||||
a1.setData("Gui::BlenderNavigationStyle")
|
||||
a1.setObjectName("Indicator_NavigationBlender")
|
||||
|
||||
a2 = QtGui.QAction(gStyle)
|
||||
a2.setIcon(QtGui.QIcon(":/icons/NavigationCAD_dark.svg"))
|
||||
a2.setText("CAD ")
|
||||
a2.setData("Gui::CADNavigationStyle")
|
||||
a2.setObjectName("Indicator_NavigationCAD")
|
||||
|
||||
a3 = QtGui.QAction(gStyle)
|
||||
a3.setIcon(QtGui.QIcon(":/icons/NavigationGesture_dark.svg"))
|
||||
a3.setText("Gesture ")
|
||||
a3.setData("Gui::GestureNavigationStyle")
|
||||
a3.setObjectName("Indicator_NavigationGesture")
|
||||
|
||||
a4 = QtGui.QAction(gStyle)
|
||||
a4.setIcon(QtGui.QIcon(":/icons/NavigationMayaGesture_dark.svg"))
|
||||
a4.setText("MayaGesture ")
|
||||
a4.setData("Gui::MayaGestureNavigationStyle")
|
||||
a4.setObjectName("Indicator_NavigationMayaGesture")
|
||||
|
||||
a5 = QtGui.QAction(gStyle)
|
||||
a5.setIcon(QtGui.QIcon(":/icons/NavigationOpenCascade_dark.svg"))
|
||||
a5.setText("OpenCascade ")
|
||||
a5.setData("Gui::OpenCascadeNavigationStyle")
|
||||
a5.setObjectName("Indicator_NavigationOpenCascade")
|
||||
|
||||
a6 = QtGui.QAction(gStyle)
|
||||
a6.setIcon(QtGui.QIcon(":/icons/NavigationOpenInventor_dark.svg"))
|
||||
a6.setText("OpenInventor ")
|
||||
a6.setData("Gui::InventorNavigationStyle")
|
||||
a6.setObjectName("Indicator_NavigationOpenInventor")
|
||||
|
||||
a7 = QtGui.QAction(gStyle)
|
||||
a7.setIcon(QtGui.QIcon(":/icons/NavigationOpenSCAD_dark.svg"))
|
||||
a7.setText("OpenSCAD ")
|
||||
a7.setData("Gui::OpenSCADNavigationStyle")
|
||||
a7.setObjectName("Indicator_NavigationOpenSCAD")
|
||||
|
||||
a8 = QtGui.QAction(gStyle)
|
||||
a8.setIcon(QtGui.QIcon(":/icons/NavigationRevit_dark.svg"))
|
||||
a8.setText("Revit ")
|
||||
a8.setData("Gui::RevitNavigationStyle")
|
||||
a8.setObjectName("Indicator_NavigationRevit")
|
||||
|
||||
a9 = QtGui.QAction(gStyle)
|
||||
a9.setIcon(QtGui.QIcon(":/icons/NavigationTinkerCAD_dark.svg"))
|
||||
a9.setText("TinkerCAD ")
|
||||
a9.setData("Gui::TinkerCADNavigationStyle")
|
||||
a9.setObjectName("Indicator_NavigationTinkerCAD")
|
||||
|
||||
a10 = QtGui.QAction(gStyle)
|
||||
a10.setIcon(QtGui.QIcon(":/icons/NavigationTouchpad_dark.svg"))
|
||||
a10.setText("Touchpad ")
|
||||
a10.setData("Gui::TouchpadNavigationStyle")
|
||||
a10.setObjectName("Indicator_NavigationTouchpad")
|
||||
|
||||
RePopulateIcons()
|
||||
|
||||
menu.addMenu(menuSettings)
|
||||
menu.addSeparator()
|
||||
menu.addAction(a0)
|
||||
|
||||
@@ -58,13 +58,15 @@
|
||||
<file>icons/NavigationOpenInventor_dark.svg</file>
|
||||
<file>icons/NavigationOpenInventor_ZoomAlt.svg</file>
|
||||
<file>icons/NavigationOpenInventor_Zoom.svg</file>
|
||||
<file alias="icons/NavigationOpenSCAD_dark.svg">icons/NavigationCAD_dark.svg</file>
|
||||
<file>icons/NavigationOpenSCAD_light.svg</file>
|
||||
<file>icons/NavigationOpenSCAD_dark.svg</file>
|
||||
<file alias="icons/NavigationOpenSCAD_Select.svg">icons/NavigationOpenCascade_Select.svg</file>
|
||||
<file alias="icons/NavigationOpenSCAD_Zoom.svg">icons/NavigationOpenCascade_PanAlt.svg</file>
|
||||
<file alias="icons/NavigationOpenSCAD_ZoomAlt.svg">icons/NavigationOpenCascade_PanAlt.svg</file>
|
||||
<file alias="icons/NavigationOpenSCAD_Rotate.svg">icons/NavigationOpenCascade_Select.svg</file>
|
||||
<file alias="icons/NavigationOpenSCAD_Pan.svg">icons/NavigationGesture_Pan.svg</file>
|
||||
<file alias="icons/NavigationTinkerCAD_dark.svg">icons/NavigationCAD_dark.svg</file>
|
||||
<file>icons/NavigationTinkerCAD_light.svg</file>
|
||||
<file>icons/NavigationTinkerCAD_dark.svg</file>
|
||||
<file alias="icons/NavigationTinkerCAD_Select.svg">icons/NavigationOpenCascade_Select.svg</file>
|
||||
<file alias="icons/NavigationTinkerCAD_Zoom.svg">icons/NavigationOpenCascade_Zoom.svg</file>
|
||||
<file alias="icons/NavigationTinkerCAD_Rotate.svg">icons/NavigationGesture_Pan.svg</file>
|
||||
|
||||
50
src/Mod/Tux/Resources/icons/NavigationOpenSCAD_dark.svg
Normal file
50
src/Mod/Tux/Resources/icons/NavigationOpenSCAD_dark.svg
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
id="svg2"
|
||||
height="64"
|
||||
width="64"
|
||||
version="1.1"
|
||||
viewBox="0 0 63.999999 63.999999"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<defs
|
||||
id="defs1" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
transform="translate(0 -988.36)"
|
||||
stroke="#2e3436"
|
||||
stroke-width="6"
|
||||
fill="none">
|
||||
<path
|
||||
id="path4144"
|
||||
d="m16 1028.4v-20c0-8 4-12 16-12s16 4 16 12v20c0 8-4 17-16 17s-16-9-16-17z" />
|
||||
<path
|
||||
id="path4209"
|
||||
d="m32 1004.4v12" />
|
||||
</g>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="fill:#2e3436;stroke:#2e3436;stroke-width:1.249;stroke-dasharray:none"
|
||||
x="23.548067"
|
||||
y="42.288612"
|
||||
id="text1"><tspan
|
||||
x="23.548067"
|
||||
y="42.288612"
|
||||
id="tspan2">OS</tspan></text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
50
src/Mod/Tux/Resources/icons/NavigationOpenSCAD_light.svg
Normal file
50
src/Mod/Tux/Resources/icons/NavigationOpenSCAD_light.svg
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
id="svg2"
|
||||
height="64"
|
||||
width="64"
|
||||
version="1.1"
|
||||
viewBox="0 0 63.999999 63.999999"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<defs
|
||||
id="defs1" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
transform="translate(0 -988.36)"
|
||||
stroke="#d1cbc9"
|
||||
stroke-width="6"
|
||||
fill="none">
|
||||
<path
|
||||
id="path4144"
|
||||
d="m16 1028.4v-20c0-8 4-12 16-12s16 4 16 12v20c0 8-4 17-16 17s-16-9-16-17z" />
|
||||
<path
|
||||
id="path4209"
|
||||
d="m32 1004.4v12" />
|
||||
</g>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="fill:#d1cbc9;stroke:#d1cbc9;stroke-width:1.249;stroke-dasharray:none"
|
||||
x="23.548067"
|
||||
y="42.288612"
|
||||
id="text1"><tspan
|
||||
x="23.548067"
|
||||
y="42.288612"
|
||||
id="tspan2">OS</tspan></text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
50
src/Mod/Tux/Resources/icons/NavigationTinkerCAD_dark.svg
Normal file
50
src/Mod/Tux/Resources/icons/NavigationTinkerCAD_dark.svg
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
id="svg2"
|
||||
height="64"
|
||||
width="64"
|
||||
version="1.1"
|
||||
viewBox="0 0 63.999999 63.999999"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<defs
|
||||
id="defs1" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
transform="translate(0 -988.36)"
|
||||
stroke="#2e3436"
|
||||
stroke-width="6"
|
||||
fill="none">
|
||||
<path
|
||||
id="path4144"
|
||||
d="m16 1028.4v-20c0-8 4-12 16-12s16 4 16 12v20c0 8-4 17-16 17s-16-9-16-17z" />
|
||||
<path
|
||||
id="path4209"
|
||||
d="m32 1004.4v12" />
|
||||
</g>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="fill:#2e3436;stroke:#2e3436;stroke-width:4.149"
|
||||
x="28.425451"
|
||||
y="43.400135"
|
||||
id="text1"><tspan
|
||||
id="tspan1"
|
||||
x="28.425451"
|
||||
y="43.400135">T</tspan></text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
50
src/Mod/Tux/Resources/icons/NavigationTinkerCAD_light.svg
Normal file
50
src/Mod/Tux/Resources/icons/NavigationTinkerCAD_light.svg
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
id="svg2"
|
||||
height="64"
|
||||
width="64"
|
||||
version="1.1"
|
||||
viewBox="0 0 63.999999 63.999999"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<defs
|
||||
id="defs1" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
transform="translate(0 -988.36)"
|
||||
stroke="#d1cbc9"
|
||||
stroke-width="6"
|
||||
fill="none">
|
||||
<path
|
||||
id="path4144"
|
||||
d="m16 1028.4v-20c0-8 4-12 16-12s16 4 16 12v20c0 8-4 17-16 17s-16-9-16-17z" />
|
||||
<path
|
||||
id="path4209"
|
||||
d="m32 1004.4v12" />
|
||||
</g>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="fill:#d1cbc9;stroke:#d1cbc9;stroke-width:4.149"
|
||||
x="28.425451"
|
||||
y="43.400135"
|
||||
id="text1"><tspan
|
||||
id="tspan1"
|
||||
x="28.425451"
|
||||
y="43.400135">T</tspan></text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
Reference in New Issue
Block a user