Draft: fix tray construction mode button for Light and Dark themes (#17886)

Fixes #17869.
This commit is contained in:
Roy-043
2024-11-16 18:04:26 +01:00
committed by GitHub
parent f08cf60155
commit 1c19a7e85d

View File

@@ -228,11 +228,14 @@ class DraftToolBar:
def _pushbutton(self,name, layout, hide=True, icon=None,
width=None, checkable=False, square=False):
button = QtWidgets.QPushButton(self.baseWidget)
button.setObjectName(name)
if square:
button.setMaximumSize(QtCore.QSize(button.height(), button.height()))
button.setFlat(True)
button = QtWidgets.QToolButton(self.baseWidget)
if width is not None:
button.setFixedHeight(width)
button.setFixedWidth(width)
else:
button = QtWidgets.QPushButton(self.baseWidget)
button.setObjectName(name)
if hide:
button.hide()
if icon:
@@ -488,7 +491,7 @@ class DraftToolBar:
self.setStyleButton()
self.constrButton = self._pushbutton(
"constrButton", self.toptray, hide=False, icon='Draft_Construction',
checkable=True, square=True)
width=self.styleButton.sizeHint().height(), checkable=True, square=True)
self.constrColor = QtGui.QColor(self.paramconstr)
self.autoGroupButton = self._pushbutton(
"autoGroup", self.bottomtray,icon=":/icons/button_invalid.svg",