From acdf40e467efd8a1a707419ea2b5c1c17a640d46 Mon Sep 17 00:00:00 2001 From: triplus Date: Fri, 9 Jun 2017 18:16:17 +0200 Subject: [PATCH] Navigation indicator orbit style improvements - Orbit style settings improvements - Tooltip information improvements - Expose orbit style options to shortcuts --- src/Mod/Tux/NavigationIndicatorGui.py | 35 ++++++++++++++++++--------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/src/Mod/Tux/NavigationIndicatorGui.py b/src/Mod/Tux/NavigationIndicatorGui.py index 500cca0d61..99be2ca369 100644 --- a/src/Mod/Tux/NavigationIndicatorGui.py +++ b/src/Mod/Tux/NavigationIndicatorGui.py @@ -50,6 +50,7 @@ text06 = translate("NavigationIndicator", "navigation style") text07 = translate("NavigationIndicator", "Page Up or Page Down key.") text08 = translate("NavigationIndicator", "Rotation focus") text09 = translate("NavigationIndicator", "Middle mouse button or key H.") +text10 = translate("NavigationIndicator", "Middle mouse button.") t0 = translate("NavigationIndicator", "Navigation style not recognized.") @@ -69,7 +70,8 @@ t1 = "

OpenInventor " + text06 + """

-""" + +""" + text08 + ": " + text10 + "

" t2 = "

CAD " + text06 + """

@@ -87,7 +89,8 @@ t2 = "

CAD " + text06 + """

-
""" + +""" + text08 + ": " + text10 + "

" t3 = "

Blender " + text06 + """

@@ -105,7 +108,8 @@ t3 = "

Blender " + text06 + """

-
""" + +""" + text08 + ": " + text10 + "

" t4 = "

MayaGesture " + text06 + """

@@ -258,9 +262,11 @@ aTooltip.setCheckable(True) gOrbit = QtGui.QActionGroup(menuSettings) aTurntable = QtGui.QAction(gOrbit) +aTurntable.setObjectName("NavigationIndicator_Turntable") aTurntable.setText(translate("NavigationIndicator", "Turntable")) aTurntable.setCheckable(True) aTrackball = QtGui.QAction(gOrbit) +aTrackball.setObjectName("NavigationIndicator_Trackball") aTrackball.setText(translate("NavigationIndicator", "Trackball")) aTrackball.setCheckable(True) @@ -379,9 +385,20 @@ def onOrbit(): """Use turntable or trackball orbit style.""" if aTurntable.isChecked(): - pView.SetInt("OrbitStyle", 1) - else: pView.SetInt("OrbitStyle", 0) + else: + pView.SetInt("OrbitStyle", 1) + + +def onOrbitShow(): + """Set turntable or trackball orbit style.""" + + gOrbit.blockSignals(True) + if pView.GetInt("OrbitStyle", 1): + aTrackball.setChecked(True) + else: + aTurntable.setChecked(True) + gOrbit.blockSignals(False) def onMenu(action): @@ -455,14 +472,9 @@ if p.GetBool("Compact", 0): if p.GetBool("Tooltip", 1): aTooltip.setChecked(True) -if pView.GetInt("OrbitStyle", 1): - aTurntable.setChecked(True) -else: - aTrackball.setChecked(True) - onCompact() onTooltip() -onOrbit() +onOrbitShow() statusBar.addPermanentWidget(indicator) statusBar.addPermanentWidget(statusBar.children()[2]) @@ -473,6 +485,7 @@ gStyle.triggered.connect(onMenu) gOrbit.triggered.connect(onOrbit) aCompact.triggered.connect(onCompact) aTooltip.triggered.connect(onTooltip) +menuOrbit.aboutToShow.connect(onOrbitShow) menu.aboutToHide.connect(indicator.clearFocus) timer.timeout.connect(setCurrent)