From 491f4ea114e75d35eeca850c69ce1f96ce4765b6 Mon Sep 17 00:00:00 2001 From: Bas Ruigrok Date: Thu, 9 May 2024 18:01:18 +0200 Subject: [PATCH] Gui: Add alignToSelection() icon and add to toolbar Co-authored-by: Max Wilfinger <6246609+maxwxyz@users.noreply.github.com> --- src/Gui/CommandView.cpp | 4 +- src/Gui/Icons/align-to-selection.svg | 148 +++++++++++++++++++++++++++ src/Gui/Icons/resource.qrc | 1 + src/Gui/Workbench.cpp | 2 +- 4 files changed, 152 insertions(+), 3 deletions(-) create mode 100644 src/Gui/Icons/align-to-selection.svg diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 6e77adfb1736..bf9427538c05 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -4079,16 +4079,16 @@ bool StdRecallWorkingView::isActive() //=========================================================================== // Std_AlignToSelection //=========================================================================== - DEF_STD_CMD_A(StdCmdAlignToSelection) StdCmdAlignToSelection::StdCmdAlignToSelection() : Command("Std_AlignToSelection") { - sGroup = "Standard-View"; + sGroup = "View"; sMenuText = QT_TR_NOOP("Align to selection"); sToolTipText = QT_TR_NOOP("Align the view with the selection"); sWhatsThis = "Std_AlignToSelection"; + sPixmap = "align-to-selection"; eType = Alter3DView; } diff --git a/src/Gui/Icons/align-to-selection.svg b/src/Gui/Icons/align-to-selection.svg new file mode 100644 index 000000000000..0d4e8945252d --- /dev/null +++ b/src/Gui/Icons/align-to-selection.svg @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + [maxwxyz] + + + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/resource.qrc b/src/Gui/Icons/resource.qrc index 614a660e4b7d..7a1decff26a6 100644 --- a/src/Gui/Icons/resource.qrc +++ b/src/Gui/Icons/resource.qrc @@ -235,6 +235,7 @@ colors.svg px.svg AddonManager.svg + align-to-selection.svg Group.svg Geofeaturegroup.svg Geoassembly.svg diff --git a/src/Gui/Workbench.cpp b/src/Gui/Workbench.cpp index dcc97d9561ba..e2cdb337dade 100644 --- a/src/Gui/Workbench.cpp +++ b/src/Gui/Workbench.cpp @@ -810,7 +810,7 @@ ToolBarItem* StdWorkbench::setupToolBars() const // View auto view = new ToolBarItem( root ); view->setCommand("View"); - *view << "Std_ViewFitAll" << "Std_ViewFitSelection" << "Std_ViewGroup" + *view << "Std_ViewFitAll" << "Std_ViewFitSelection" << "Std_ViewGroup" << "Std_AlignToSelection" << "Separator" << "Std_DrawStyle" << "Std_TreeViewActions" << "Separator" << "Std_MeasureDistance" << "Std_Measure";