From 91738ab68bdecd2179a894a3490458c95610e367 Mon Sep 17 00:00:00 2001 From: David Holdeman Date: Fri, 17 Mar 2023 20:25:15 -0500 Subject: [PATCH 1/3] Path: set property --- src/Mod/Path/Path/Base/Gui/Util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/Path/Base/Gui/Util.py b/src/Mod/Path/Path/Base/Gui/Util.py index 5516a20b51..eb567be1e3 100644 --- a/src/Mod/Path/Path/Base/Gui/Util.py +++ b/src/Mod/Path/Path/Base/Gui/Util.py @@ -89,10 +89,10 @@ def updateInputField(obj, prop, widget, onBeforeChange=None): break if exprSet: widget.setReadOnly(True) - widget.setStyleSheet("color: gray") + widget.setProperty("exprSet", "true") else: widget.setReadOnly(False) - widget.setStyleSheet("color: black") + widget.setProperty("exprSet", "false") widget.update() if isDiff: From 3d76101c20d59706b205f2252c27d403e3e5ff49 Mon Sep 17 00:00:00 2001 From: David Holdeman Date: Fri, 17 Mar 2023 21:25:15 -0500 Subject: [PATCH 2/3] Path: set property for spinbox --- src/Mod/Path/Path/Base/Gui/Util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/Path/Base/Gui/Util.py b/src/Mod/Path/Path/Base/Gui/Util.py index eb567be1e3..0170b33f57 100644 --- a/src/Mod/Path/Path/Base/Gui/Util.py +++ b/src/Mod/Path/Path/Base/Gui/Util.py @@ -199,10 +199,10 @@ class QuantitySpinBox(QtCore.QObject): self.lastWidgetText = self.widget.text() # update last widget value if expr: self.widget.setReadOnly(True) - self.widget.setStyleSheet("color: gray") + self.widget.setProperty("exprSet", "true") else: self.widget.setReadOnly(False) - self.widget.setStyleSheet("color: black") + self.widget.setProperty("exprSet", "false") def updateProperty(self): """updateProperty() ... update the bound property with the value from the spin box""" From a5488f91fd955aa2f4a2ec85056fc315a15028b0 Mon Sep 17 00:00:00 2001 From: David Holdeman Date: Sat, 18 Mar 2023 09:23:58 -0500 Subject: [PATCH 3/3] Path: polish to apply --- src/Mod/Path/Path/Base/Gui/Util.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Mod/Path/Path/Base/Gui/Util.py b/src/Mod/Path/Path/Base/Gui/Util.py index 0170b33f57..b2244635f7 100644 --- a/src/Mod/Path/Path/Base/Gui/Util.py +++ b/src/Mod/Path/Path/Base/Gui/Util.py @@ -90,9 +90,13 @@ def updateInputField(obj, prop, widget, onBeforeChange=None): if exprSet: widget.setReadOnly(True) widget.setProperty("exprSet", "true") + widget.style().unpolish(widget) + widget.ensurePolished() else: widget.setReadOnly(False) widget.setProperty("exprSet", "false") + widget.style().unpolish(widget) + widget.ensurePolished() widget.update() if isDiff: @@ -200,9 +204,13 @@ class QuantitySpinBox(QtCore.QObject): if expr: self.widget.setReadOnly(True) self.widget.setProperty("exprSet", "true") + self.widget.style().unpolish(self.widget) + self.widget.ensurePolished() else: self.widget.setReadOnly(False) self.widget.setProperty("exprSet", "false") + self.widget.style().unpolish(self.widget) + self.widget.ensurePolished() def updateProperty(self): """updateProperty() ... update the bound property with the value from the spin box"""