From 002619ad831c1bad93895f6709c49bd9bbf63324 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 28 Jun 2016 20:42:04 +0300 Subject: [PATCH] Moves the arrow tool from the toolbar to all the tabs in the toolbox as discussed in https://groups.google.com/forum/#!topic/valentina-project-list/6RvYFlJLmMM Thanks Benjamin Nauck for idea and the patch. --HG-- branch : develop --- src/app/valentina/mainwindow.cpp | 37 +- src/app/valentina/mainwindow.h | 3 + src/app/valentina/mainwindow.ui | 346 ++++++++++++------ src/libs/vmisc/share/resources/icon.qrc | 1 + .../resources/icon/32x32/arrow_cursor.png | Bin 543 -> 514 bytes .../resources/icon/32x32/arrow_cursor@2x.png | Bin 0 -> 668 bytes .../share/resources/icon/svg/arrow_cursor.svg | 83 +++++ 7 files changed, 354 insertions(+), 116 deletions(-) create mode 100644 src/libs/vmisc/share/resources/icon/32x32/arrow_cursor@2x.png create mode 100644 src/libs/vmisc/share/resources/icon/svg/arrow_cursor.svg 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 e440ef784c15614a10be0a436b4acc737ada84cb..823837f4eb4a19ea4bd9faf46fa0d24966ad4fb1 100644 GIT binary patch delta 499 zcmVMzCV_|S*E^l&Yo9;Xs0004hNkl6bA55sw2pYgV>0;13g1ki2>GLq60Zb=T3BB?SC2CsZuI91Be354L$x9sN{q)6yf&U&ML-lw6v69M zh2YIpf#7URBenph5jz1U5qklq5C;J!5V?S|5k~>aL>vt$3vm*l48+NRb0ZE88jVH_ zVDAz_gl7c=L4UxlRx6F7h?$wAC}JW?0C+_Q7jmA@{ zfbn?Dj^il&{8P`i?IaAtzZPuUP5`t^0c3^)0Hl;d-}kdE3`+qJk;3+!&?BOx=vlbR zdqD_sueH7d@SfRHwOXyMl)CQqdO}Kx<#M^2&1P3;&!yJ-GFm9w0Px#_QmWJM_cvQ`wbn0Z`2JDxh$vYs7CfC!x!di=&1Uo2)NlZR pl=2b4%5~ijB6 delta 529 zcmV+s0`C2S1fK+u8Gi%-007x@vVQ;o00d`2O+f$whM+O%mR|q>0oF-GK~zY`ozy>Q z)L);72k&ZW1+n#@5QQpKx7MLf4sPwzrAQABZz;G~ghEGK=+wpk zNU2CC5eEk;Dk5^iL8u)>MTLMx`|WVKpf}j$eKLe38(A`&dV3|dCLZ_FND~GC9umE!jMPmcURi1fTO%;0z-ydLsmd1a08KIY5sG? z0yqxTn4wIT92P*4Miwy`8=ycl2v0dv8~4 zpo7+A5IQ71GJlC*p^=lg4CBomIYHX00l+pypPzUQ0!FAZ&Lj@vKu~x%x}2y%4Yh1V zwgkF>KLi8>d_V}Z(fGv-qK7Si=K@gu=c!lk{5Z4feeqs46o+&K zoSREL4|WsWon1E}a5+A(Gn_~+(!JlJL0p)seSC5(_J2&wGc`RsBfYDZZ;ss;B25~n zI~I`hMV>{sd0ZK6u7imOJoq-v!s@H&o1ct;R2<-WxPKa*DM!GiVM)4{bVfezFTJ_A z;vjPDXY8ltu-_53IPF^knGiT@3v3U8(i$l%;5?ml(?R8v)$LdQ8e|hK*ERtqWRx<> T=pF9>015yANkvXXu0mjfhM({Z 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 0000000000000000000000000000000000000000..2f9ddb804b8302c70f0ae53d61888c4b024b796a GIT binary patch literal 668 zcmV;N0%QG&P)QJonhiyiVpp3koe>S8iG-z-VwcDpz}VxT@tm1Ya>Zyh=kce-!UG{8Rr3Y72j1J> zh^@%W^#e~4By&9gH+Hwvegu&5cUBa_L*%O(gQBH}H=KLB45UIF-sa01{P z!dU>H5H14vf{+W~1Hx4R?FfYcG$RxS(27tBKqEqF0Bs0H0Gbet0kj}g0?>d^8NhXf zS^!)|s13kXgjxYyM5rCWHH1b0Tta9Jz!ii>0bD?69H8q6tpIcxp*4W6BD4z7MTE)# zi^U@QhS}u0H{JZ33WL{{?RH!BPyDH4AEvq5fFwy|I-SaVK9@92Pd<<1_;@FufS%1^ zOp*(bBuVz{fW&cpvL;PaiK6JZW@&XAgIomoZ}=@BQ530bLD83^AAm=4S}+=ooNPgn z*W>+{wM#&T!=W4whrAa21m0Si#vs=YNc1yndnjx{-VvGpnf2;gAaM4O)Vbk7VG9IG zACp_6=o=yXNSb%&vr*N8GIu^3H7zhbEZyUIIF(O_MWgN;p=?zBFECAL0igw<1)&9m z7Ll&E?|L;cmB+*=%+M_+)vXjpbDf_WQl8*K1j=Rx%h2j>G=~-dWvc!&!3q z_y2Fet-Y + + + + + + + + + + + + image/svg+xml + + + + + + + + +