diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index cc5b835b6..03b76c2a2 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -124,7 +124,8 @@ MainWindow::MainWindow(QWidget *parent) toolOptions(nullptr), groupsWidget(nullptr), detailsWidget(nullptr), - lock(nullptr) + lock(nullptr), + toolButtonPointerList() { for (int i = 0; i < MaxRecentFiles; ++i) { @@ -1736,6 +1737,18 @@ void MainWindow::ToolBarTools() //--------------------------------------------------------------------------------------------------------------------- void MainWindow::InitToolButtons() { + toolButtonPointerList.append(ui->toolButtonPointerPoint); + toolButtonPointerList.append(ui->toolButtonPointerLine); + toolButtonPointerList.append(ui->toolButtonPointerCurve); + toolButtonPointerList.append(ui->toolButtonPointerArc); + toolButtonPointerList.append(ui->toolButtonPointerDetail); + toolButtonPointerList.append(ui->toolButtonPointerOperations); + + for (auto pointer : toolButtonPointerList) + { + connect(pointer, &QToolButton::clicked, this, &MainWindow::ArrowTool); + } + connect(ui->toolButtonEndLine, &QToolButton::clicked, this, &MainWindow::ToolEndLine); connect(ui->toolButtonLine, &QToolButton::clicked, this, &MainWindow::ToolLine); connect(ui->toolButtonAlongLine, &QToolButton::clicked, this, &MainWindow::ToolAlongLine); @@ -1827,7 +1840,10 @@ void MainWindow::CancelTool() switch ( currentTool ) { case Tool::Arrow: - ui->actionArrowTool->setChecked(false); + for (auto pointer : toolButtonPointerList) + { + pointer->setChecked(false); + } helpLabel->setText(""); ui->actionStopTool->setEnabled(true); @@ -1974,7 +1990,10 @@ void MainWindow::ArrowTool() { qCDebug(vMainWindow, "Arrow tool."); CancelTool(); - ui->actionArrowTool->setChecked(true); + for (auto pointer : toolButtonPointerList) + { + pointer->setChecked(true); + } ui->actionStopTool->setEnabled(false); currentTool = Tool::Arrow; emit EnableItemMove(true); @@ -3161,6 +3180,12 @@ void MainWindow::SetEnableTool(bool enable) ui->actionLast_tool->setEnabled(drawTools); + for (auto pointer : toolButtonPointerList) + { + pointer->setEnabled(drawTools || modelingTools); + pointer->setChecked(drawTools || modelingTools); + } + //Modeling Tools ui->toolButtonUnionDetails->setEnabled(modelingTools); @@ -3444,7 +3469,10 @@ void MainWindow::LastUsedTool() switch ( lastUsedTool ) { case Tool::Arrow: - ui->actionArrowTool->setChecked(true); + for (auto pointer : toolButtonPointerList) + { + pointer->setChecked(true); + } ArrowTool(); break; case Tool::BasePoint: @@ -3985,7 +4013,6 @@ void MainWindow::WindowsLocale() //--------------------------------------------------------------------------------------------------------------------- void MainWindow::ToolBarStyles() { - ToolBarStyle(ui->toolBarArrows); ToolBarStyle(ui->toolBarDraws); ToolBarStyle(ui->toolBarOption); ToolBarStyle(ui->toolBarStages); diff --git a/src/app/valentina/mainwindow.h b/src/app/valentina/mainwindow.h index 1f8b5cd91..88d59c8de 100644 --- a/src/app/valentina/mainwindow.h +++ b/src/app/valentina/mainwindow.h @@ -50,6 +50,7 @@ class DialogTool; class DialogHistory; class VWidgetGroups; class VWidgetDetails; +class QToolButton; /** * @brief The MainWindow class main windows. @@ -280,6 +281,8 @@ private: VWidgetDetails *detailsWidget; std::shared_ptr> lock; + QList toolButtonPointerList; + void SetDefaultHeight(); void SetDefaultSize(); diff --git a/src/app/valentina/mainwindow.ui b/src/app/valentina/mainwindow.ui index d1e500848..0bad623ad 100644 --- a/src/app/valentina/mainwindow.ui +++ b/src/app/valentina/mainwindow.ui @@ -48,15 +48,15 @@ Tools - 0 + 4 0 0 - 130 - 318 + 117 + 358 @@ -82,32 +82,6 @@ QFormLayout::AllNonFixedFieldsGrow - - - - false - - - Point at distance and angle - - - ... - - - - :/toolicon/32x32/segment.png:/toolicon/32x32/segment.png - - - - 32 - 32 - - - - true - - - @@ -368,6 +342,32 @@ + + + + false + + + Tool pointer + + + ... + + + + :/icon/32x32/arrow_cursor.png:/icon/32x32/arrow_cursor.png + + + + 32 + 32 + + + + true + + + @@ -394,6 +394,32 @@ + + + + false + + + Point at distance and angle + + + ... + + + + :/toolicon/32x32/segment.png:/toolicon/32x32/segment.png + + + + 32 + 32 + + + + true + + + @@ -402,7 +428,7 @@ 0 0 130 - 58 + 110 @@ -425,10 +451,33 @@ Line - - QFormLayout::AllNonFixedFieldsGrow - + + + false + + + Tool pointer + + + ... + + + + :/icon/32x32/arrow_cursor.png:/icon/32x32/arrow_cursor.png + + + + 32 + 32 + + + + true + + + + false @@ -454,7 +503,7 @@ - + false @@ -488,7 +537,7 @@ 0 0 130 - 196 + 248 @@ -511,36 +560,7 @@ Curve - - QFormLayout::AllNonFixedFieldsGrow - - - - - false - - - Simple curve - - - ... - - - - :/toolicon/32x32/spline.png:/toolicon/32x32/spline.png - - - - 32 - 32 - - - - true - - - - + false @@ -566,7 +586,7 @@ - + false @@ -592,7 +612,7 @@ - + false @@ -618,7 +638,7 @@ - + false @@ -644,7 +664,30 @@ - + + + + false + + + ... + + + + :/toolicon/32x32/cubic_bezier_path.png:/toolicon/32x32/cubic_bezier_path.png + + + + 32 + 32 + + + + true + + + + false @@ -670,7 +713,7 @@ - + false @@ -696,17 +739,46 @@ - - + + false + + Tool pointer + + + ... + + + + :/icon/32x32/arrow_cursor.png:/icon/32x32/arrow_cursor.png + + + + 32 + 32 + + + + true + + + + + + + false + + + Simple curve + ... - :/toolicon/32x32/cubic_bezier_path.png:/toolicon/32x32/cubic_bezier_path.png + :/toolicon/32x32/spline.png:/toolicon/32x32/spline.png @@ -727,7 +799,7 @@ 0 0 130 - 196 + 248 @@ -750,10 +822,7 @@ Arc - - QFormLayout::AllNonFixedFieldsGrow - - + false @@ -779,7 +848,7 @@ - + false @@ -805,7 +874,7 @@ - + false @@ -831,7 +900,7 @@ - + false @@ -857,7 +926,7 @@ - + false @@ -883,7 +952,7 @@ - + false @@ -909,7 +978,7 @@ - + false @@ -935,7 +1004,7 @@ - + false @@ -961,6 +1030,32 @@ + + + + false + + + Tool pointer + + + ... + + + + :/icon/32x32/arrow_cursor.png:/icon/32x32/arrow_cursor.png + + + + 32 + 32 + + + + true + + + @@ -984,6 +1079,32 @@ + + + false + + + Tool pointer + + + ... + + + + :/icon/32x32/arrow_cursor.png:/icon/32x32/arrow_cursor.png + + + + 32 + 32 + + + + true + + + + false @@ -1009,7 +1130,7 @@ - + false @@ -1043,7 +1164,7 @@ 0 0 130 - 58 + 104 @@ -1066,10 +1187,33 @@ Detail - - QFormLayout::AllNonFixedFieldsGrow - + + + false + + + Tool pointer + + + ... + + + + :/icon/32x32/arrow_cursor.png:/icon/32x32/arrow_cursor.png + + + + 32 + 32 + + + + true + + + + false @@ -1095,7 +1239,7 @@ - + false @@ -1433,26 +1577,6 @@ - - - - 10 - - - - Toolbar pointer - - - Qt::ToolButtonTextUnderIcon - - - TopToolBarArea - - - false - - - QDockWidget::NoDockWidgetFeatures diff --git a/src/libs/vmisc/share/resources/icon.qrc b/src/libs/vmisc/share/resources/icon.qrc index 74cb170cd..49eb8ac59 100644 --- a/src/libs/vmisc/share/resources/icon.qrc +++ b/src/libs/vmisc/share/resources/icon.qrc @@ -4,6 +4,7 @@ icon/32x32/draw.png icon/32x32/kontur.png icon/32x32/arrow_cursor.png + icon/32x32/arrow_cursor@2x.png icon/32x32/new_draw.png icon/32x32/option_draw.png icon/32x32/table.png diff --git a/src/libs/vmisc/share/resources/icon/32x32/arrow_cursor.png b/src/libs/vmisc/share/resources/icon/32x32/arrow_cursor.png index e440ef784..823837f4e 100644 Binary files a/src/libs/vmisc/share/resources/icon/32x32/arrow_cursor.png and b/src/libs/vmisc/share/resources/icon/32x32/arrow_cursor.png differ diff --git a/src/libs/vmisc/share/resources/icon/32x32/arrow_cursor@2x.png b/src/libs/vmisc/share/resources/icon/32x32/arrow_cursor@2x.png new file mode 100644 index 000000000..2f9ddb804 Binary files /dev/null and b/src/libs/vmisc/share/resources/icon/32x32/arrow_cursor@2x.png differ diff --git a/src/libs/vmisc/share/resources/icon/svg/arrow_cursor.svg b/src/libs/vmisc/share/resources/icon/svg/arrow_cursor.svg new file mode 100644 index 000000000..48b83cb61 --- /dev/null +++ b/src/libs/vmisc/share/resources/icon/svg/arrow_cursor.svg @@ -0,0 +1,83 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + +