diff --git a/src/Gui/Stylesheets/FreeCAD.qss b/src/Gui/Stylesheets/FreeCAD.qss index 9054f55c8b..cba699208d 100644 --- a/src/Gui/Stylesheets/FreeCAD.qss +++ b/src/Gui/Stylesheets/FreeCAD.qss @@ -1278,14 +1278,14 @@ QToolButton:disabled { } QToolButton:checked { - background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 @ButtonBottomBackgroundColor, stop:0.7 @ButtonTopBackgroundColor, stop:1 @ButtonTopBackgroundColor); + background-color: @ToolButtonCheckedBackground; border-radius: @InputFieldBorderRadius; - border: 1px solid @AccentColor; + border: 1px solid @ToolButtonCheckedBorderColor; } QToolButton:checked:disabled { background-color: @GeneralDisabledBackgroundColor; - color: @AccentColor; + border: 1px solid @ButtonBorderColor; } QToolButton:checked:hover { diff --git a/src/Gui/Stylesheets/parameters/FreeCAD Dark.yaml b/src/Gui/Stylesheets/parameters/FreeCAD Dark.yaml index 51d7e9f412..c47bf12123 100644 --- a/src/Gui/Stylesheets/parameters/FreeCAD Dark.yaml +++ b/src/Gui/Stylesheets/parameters/FreeCAD Dark.yaml @@ -9,6 +9,8 @@ CheckedButtonTopBackgroundColor: "darken(@ButtonTopBackgroundColor, 5)" DefaultButtonBottomBackgroundColor: "blend(@ButtonBottomBackgroundColor, @AccentColor, 10)" DefaultButtonTopBackgroundColor: "blend(@ButtonTopBackgroundColor, @AccentColor, 10)" DefaultButtonBorderColor: "blend(@ButtonBorderColor, @AccentColor, 20)" +ToolButtonCheckedBorderColor: "@PrimaryColorLighten5" +ToolButtonCheckedBackground: "@CheckedButtonTopBackgroundColor" CheckBoxBackgroundColor: "@TextEditFieldBackgroundColor" CheckBoxBorderColor: "@GeneralBorderColor" DialogBackgroundColor: "@PrimaryColorLighten3" diff --git a/src/Gui/Stylesheets/parameters/FreeCAD Light.yaml b/src/Gui/Stylesheets/parameters/FreeCAD Light.yaml index 0883a69ab4..ec5a474df1 100644 --- a/src/Gui/Stylesheets/parameters/FreeCAD Light.yaml +++ b/src/Gui/Stylesheets/parameters/FreeCAD Light.yaml @@ -9,6 +9,8 @@ CheckedButtonTopBackgroundColor: "darken(@ButtonTopBackgroundColor, 5)" DefaultButtonBottomBackgroundColor: "blend(@ButtonBottomBackgroundColor, @AccentColor, 5)" DefaultButtonTopBackgroundColor: "blend(@ButtonTopBackgroundColor, @AccentColor, 5)" DefaultButtonBorderColor: "blend(@ButtonBorderColor, @AccentColor, 40)" +ToolButtonCheckedBorderColor: "darken(@ButtonBorderColor, 15)" +ToolButtonCheckedBackground: "@CheckedButtonBottomBackgroundColor" CheckBoxBackgroundColor: "@TextEditFieldBackgroundColor" CheckBoxBorderColor: "@GeneralBorderColor" DialogBackgroundColor: "@PrimaryColorLighten3" diff --git a/src/Mod/Part/Gui/DlgPrimitives.cpp b/src/Mod/Part/Gui/DlgPrimitives.cpp index 59266aa92d..2673b606b0 100644 --- a/src/Mod/Part/Gui/DlgPrimitives.cpp +++ b/src/Mod/Part/Gui/DlgPrimitives.cpp @@ -2533,6 +2533,9 @@ void Location::onPlacementChanged() void Location::onViewPositionButton() { Gui::Document* doc = Gui::Application::Instance->activeDocument(); + + ui->viewPositionButton->setChecked(true); + if (!doc) { return; } @@ -2560,6 +2563,7 @@ void Location::pickCallback(void* ud, SoEventCallback* n) { const SoMouseButtonEvent* mbe = static_cast(n->getEvent()); Gui::View3DInventorViewer* view = static_cast(n->getUserData()); + Location* dlg = static_cast(ud); // Mark all incoming mouse button events as handled, especially, to deactivate the selection node n->getAction()->setHandled(); @@ -2569,7 +2573,6 @@ void Location::pickCallback(void* ud, SoEventCallback* n) if (point) { SbVec3f pnt = point->getPoint(); SbVec3f nor = point->getNormal(); - Location* dlg = static_cast(ud); dlg->ui->XPositionQSB->setValue(pnt[0]); dlg->ui->YPositionQSB->setValue(pnt[1]); dlg->ui->ZPositionQSB->setValue(pnt[2]); @@ -2585,8 +2588,8 @@ void Location::pickCallback(void* ud, SoEventCallback* n) n->setHandled(); view->setEditing(false); view->setRedirectToSceneGraph(false); - Location* dlg = static_cast(ud); dlg->activeView = nullptr; + dlg->ui->viewPositionButton->setChecked(false); view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), pickCallback, ud); SoNode* root = view->getSceneGraph(); if (root && root->getTypeId().isDerivedFrom(Gui::SoFCUnifiedSelection::getClassTypeId())) { diff --git a/src/Mod/Part/Gui/Location.ui b/src/Mod/Part/Gui/Location.ui index 4dee0b7cab..64ba1a9bc1 100644 --- a/src/Mod/Part/Gui/Location.ui +++ b/src/Mod/Part/Gui/Location.ui @@ -7,7 +7,7 @@ 0 0 280 - 307 + 400 @@ -113,6 +113,9 @@ Pick Position + + true + @@ -269,7 +272,7 @@ the sketch plane's normal vector will be used Gui::QuantitySpinBox - QWidget + QAbstractSpinBox
Gui/QuantitySpinBox.h