From b29778aa1a482f5f20f8a15bc422c2f3df70410f Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 11 Jul 2014 16:10:54 +0300 Subject: [PATCH] ZoomOriginal and ZoomFitBest. --HG-- branch : develop --- src/app/mainwindow.cpp | 21 ++++++++++-- src/app/mainwindow.ui | 32 +++++++++++++++--- .../16x16/actions/zoom-fit-best.png | Bin 0 -> 704 bytes .../16x16/actions/zoom-original.png | Bin 0 -> 667 bytes .../24x24/actions/zoom-fit-best.png | Bin 0 -> 1221 bytes .../win.icon.theme/24x24/actions/zoom-in.png | Bin 1268 -> 1224 bytes .../24x24/actions/zoom-original.png | Bin 0 -> 1171 bytes .../win.icon.theme/24x24/actions/zoom-out.png | Bin 1123 -> 1124 bytes .../32x32/actions/zoom-fit-best.png | Bin 0 -> 1415 bytes .../32x32/actions/zoom-original.png | Bin 0 -> 1223 bytes src/app/share/resources/theme.qrc | 6 ++++ src/app/widgets/vgraphicssimpletextitem.cpp | 2 +- src/app/widgets/vmaingraphicsview.cpp | 27 +++++++++++++++ src/app/widgets/vmaingraphicsview.h | 2 ++ 14 files changed, 82 insertions(+), 8 deletions(-) create mode 100644 src/app/share/resources/icons/win.icon.theme/16x16/actions/zoom-fit-best.png create mode 100644 src/app/share/resources/icons/win.icon.theme/16x16/actions/zoom-original.png create mode 100644 src/app/share/resources/icons/win.icon.theme/24x24/actions/zoom-fit-best.png create mode 100644 src/app/share/resources/icons/win.icon.theme/24x24/actions/zoom-original.png create mode 100644 src/app/share/resources/icons/win.icon.theme/32x32/actions/zoom-fit-best.png create mode 100644 src/app/share/resources/icons/win.icon.theme/32x32/actions/zoom-original.png diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 376dfcaa6..e94be27c1 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -1067,6 +1067,9 @@ void MainWindow::ToolBarTools() Qt::ControlModifier + Qt::Key_Minus + Qt::KeypadModifier}; ui->actionZoomOut->setShortcuts(zoomOutShortcuts); connect(ui->actionZoomOut, &QAction::triggered, view, &VMainGraphicsView::ZoomOut); + + connect(ui->actionZoomOriginal, &QAction::triggered, view, &VMainGraphicsView::ZoomOriginal); + connect(ui->actionZoomFitBest, &QAction::triggered, view, &VMainGraphicsView::ZoomFitBest); } //--------------------------------------------------------------------------------------------------------------------- @@ -1737,6 +1740,8 @@ void MainWindow::SetEnableWidgets(bool enable) ui->actionEdit_pattern_code->setEnabled(enable); ui->actionZoomIn->setEnabled(enable); ui->actionZoomOut->setEnabled(enable); + ui->actionZoomFitBest->setEnabled(enable); + ui->actionZoomOriginal->setEnabled(enable); } //--------------------------------------------------------------------------------------------------------------------- @@ -2179,6 +2184,10 @@ MainWindow::~MainWindow() */ void MainWindow::LoadPattern(const QString &fileName) { + // Fit scene to view + VAbstractTool::NewSceneRect(sceneDraw, view); + VAbstractTool::NewSceneRect(sceneDetails, view); + qApp->setOpeningPattern();//Begin opening file try { @@ -2231,6 +2240,15 @@ void MainWindow::LoadPattern(const QString &fileName) helpLabel->setText(tr("File loaded")); qApp->setOpeningPattern();// End opening file + + VAbstractTool::NewSceneRect(sceneDraw, view); + VAbstractTool::NewSceneRect(sceneDetails, view); + + ActionDetails(true); + view->ZoomFitBest(); + + ActionDraw(true); + view->ZoomFitBest(); } //--------------------------------------------------------------------------------------------------------------------- @@ -2292,9 +2310,6 @@ void MainWindow::OpenPattern(const QString &filePath) if (curFile.isEmpty() && this->isWindowModified() == false) { LoadPattern(filePath); - - VAbstractTool::NewSceneRect(sceneDraw, view); - VAbstractTool::NewSceneRect(sceneDetails, view); } else { diff --git a/src/app/mainwindow.ui b/src/app/mainwindow.ui index 3bce59e51..5c7b8c73d 100644 --- a/src/app/mainwindow.ui +++ b/src/app/mainwindow.ui @@ -47,7 +47,7 @@ 0 0 - 150 + 144 150 @@ -302,7 +302,7 @@ 0 0 - 150 + 100 58 @@ -378,7 +378,7 @@ 0 0 - 150 + 100 104 @@ -579,7 +579,7 @@ 0 0 - 150 + 100 58 @@ -779,6 +779,8 @@ + + @@ -1062,6 +1064,28 @@ Edit pattern XML code + + + false + + + + + + ZoomOriginal + + + + + false + + + + + + ZoomFitBest + + diff --git a/src/app/share/resources/icons/win.icon.theme/16x16/actions/zoom-fit-best.png b/src/app/share/resources/icons/win.icon.theme/16x16/actions/zoom-fit-best.png new file mode 100644 index 0000000000000000000000000000000000000000..fbba7abdafc4e275e27e6c5cb7f6886fc8d4caa9 GIT binary patch literal 704 zcmV;x0zdtUP)Lo zK~y-)z0*rbRACgr@&9-49cPpraVj5~WRzlvq(lzXqQ@p@l`Sm7MJ}Xh5ws|1;i48o z5G^Ld%?QoH7DWgVgQiqC1|d0M(Zj?P44rWp8GDW6{qDVA3*FcVx#}#>;&%?`0b7mM z$D5|brrC}d^d5ps?~egZD7*+UhPz;hd;83P1MRUrXyO@;s=;(53WZC!FtiMg-A4HE z;O4-&5pWrWpe51s)BRU#l4lz76_7ubA{)5#rD$d$T?yJL`us08@8Imn0C@auva@(D zl_eUD#-)^6AP^|sUE(ELdTVYrp5BI$zmtbej+O(MvibVyiqwahMWWGYLMi3wx^71z zk<{$`5>Kxk_({g}lKFlDU?UKSG-75Qf0b@eOuS1tj^hX+5JKQ~yUlPooUX4h^2n^1 zNa@c7Y`KDIiqx`Q5DW&3HBA#rDF9{Lwl**@Pyl3+s|Ks9OS!;M%OsYx`$y-k=YtV< zC=@DIN@C?R_jM-Se6+DFedJ)JQC(A;l~Rgi za?#kaYya}a;5Q$R6=U>#*TyY0hQK2Vv9w9RhvgXlhSG)BlU1G)pGUrmCF}=JCd=^{ zCOVa%rFnB<9jLnx9-|OTOaoqo%7W-dsT(LT(=_+U~t*xcGEsYOPo=eC+t^lxy$SW2tcj5=XD5{CAw!om={`H9#q- mx?PW>{i5v0EN{E`Z}A5sEcF5NHq6!l0000 z;g8#Zu!Cz@A`icP{pr_{H=lk#TXFQ|+uax6y#~rX`TOtxJ*}cMw;93?-D3#YFMweH zL+nm&hQK`^$`{|>1=4Wh=7*PIT^GLwww?b5;)C#|2cHiB)qG+I-sgpBfX{YI2Jda3 zk6eAX6{ca%j)(68nohwD`0?xSO^_M}uk96>2Dq=4WN_Q?dHs=R+u#Olz4tDl_88oN zPhWpu0IK=I;I=Undl)#ZI^;_mbu41rW@@?_X`+H%w!tj&V-%jzktoRI+-_5|#z=Y`q!#VN{rgLvHn9lnS z!mimnF09^rZ_l2SPxlt~ojSr|vEUnn*}Mk~7V{M_q7kfFf5t5!{sF{K7z}1M0O`X( z{Efi?C}uF@BZJ}0MGV?=gfJ2kgXR=@2CYfAf%qqb_T(oFniF;43eaTXm?G8;QjL4;P@-`kwVH0000YdQ@0+ zQ*UN;cVTj600214D=#nC%goCzPEIUH)ypqR2LLwM23V|)TyX#Z002ovPDHLkV1mF% BE(ibs literal 0 HcmV?d00001 diff --git a/src/app/share/resources/icons/win.icon.theme/24x24/actions/zoom-fit-best.png b/src/app/share/resources/icons/win.icon.theme/24x24/actions/zoom-fit-best.png new file mode 100644 index 0000000000000000000000000000000000000000..80a56b9185c845795b3b54ee21afc55a2e0279a7 GIT binary patch literal 1221 zcmV;$1UmbPP)gCKrn?f9(#EZ7H| zivOp;!ry|p;vJAxSgWuozyJb)10n!4pyDr+opFYmarVvy7XI=Wh;<;Qk~Hzr1*vV5 z9tx@v*}fs&aUDN-KAzljvU{j8Hi!_tV3$JHW_mAKzIu8PfqA>Z=l5gGCZG)biRI-5 z&F{XDljT}mA#ks|(5EihXz_~Ud6zr8LkJPWh^f?1YaQ4@b#>pEw|fpkZpEf_Rpxw_ znGiv=71Y+&UT_@8i$o%6;cz%xNsfoT%VW>`e5$gtva_V5B&oGw>@au8Q;&u&p>!Oj zp6RD^|Md(M({Vf#2su$d$@K4b?6@d|z*=kn2`w)#?=3AY)qotEAMouz>KUXc9$dhx zk!WkPQ{9-)6>cC9Fj7iwj1fWz01H@Sj4UiHj29FXBmkM=mp+uTNU{gsA^@#U;CZtB zTvx8LDYBxXBCo!_K2yqD;ZjOlS67!&RaKP-sFwEb9+c8`ox3>=mn~LC7 z_Al7j&*R*}{lq%xm<&@_yI5xxMo+|A9qqCyYrbg>JU%+_Y$!D)q_nkHdpzgQi0)pn z{8zc{`*Xt)R$%S7V5%88OVKuQ00)ycq$AV@U^WoL;=7KMB(#S>=M78my3(BpCZq8b z{H}{51VXF@`2h{DwcSj2!@;;!@W^bJWMVVM&O}>SPbQ)bYx00000NkvXXu0mjf?czjv literal 0 HcmV?d00001 diff --git a/src/app/share/resources/icons/win.icon.theme/24x24/actions/zoom-in.png b/src/app/share/resources/icons/win.icon.theme/24x24/actions/zoom-in.png index 64606208e09ea1117c68acd39ffa61729185cb20..fe0fb3a8ebddebd706c5699e87e43b56c1de4403 100644 GIT binary patch literal 1224 zcmV;(1ULJMP)aO!NKT@{;~-g)nR-+O-a$2K#}WvI_T=WuxV zexAekobw#GnV7qa+Y_&KSvQ(0{xf4q6KsAEmNu7R#2lakC;~16hd}IM)BQUEShNqe zRs2uD;>IwJSOwM_7$Y%AKm!7S4I%_IA(IQp&isvg#XsK*q83CszE0j$3{7!me#w0vphtH0EeD(KBUTTYfAd(-0zo7Ug_3>GuJtYt5>zhMiNv_bO4U3eTrz zQAx}Cc|~_-gzQjCnP9J{?L^81Tt@`TiqrEh)lNK{;TR7;m5KJhyjt#Bz_w+5qf|8{ zeQ!qD(2f-|^9un3m`@tI(r0h%%wGM?nT-B51?1MhIW8)+N|2HjJY7HI`hbo+sQfMq zsS1dv%!kj73IT4vv8MfxSfIYO+dbS73l2a5J+3G+^x-j)^GKCM%4q{~&cAvfnT(y% zp@`ixEaHTvGUnagr!pIU?Qz?qNr$*6T2J_aC)Ty(jw=eM)-M=&DLrV3`wBwA{Vget zB`O977+HieCOgeZ1RcxK#yD*!FFJb~&$(CvVGI|O!m97;b^Ul2N|gYJOxFq_rNJV5 zaDb9WG1`ir@`uObGM16%F!`Q{A0UT=?H7X`(OxHasH>iwkmHRh2+M#ikjm)JXsj2R z%0gJpg9B2!1))GH_sH??6UDg&`O7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vqM{9ZzaPfh3k*ZB7cXlPrx&G|yc~9{yu}(@6z^z@SLQNg)fVzrN0>bq lxSd746LQV&)Q{md+uwa!wS*}tr$7Jz002ovPDHLkV1k8b8&CiM literal 0 HcmV?d00001 diff --git a/src/app/share/resources/icons/win.icon.theme/24x24/actions/zoom-out.png b/src/app/share/resources/icons/win.icon.theme/24x24/actions/zoom-out.png index 61fc868eaec9422bab44c961e875da590ea1c2df..f605abbbf73977cbf2fdd21951e800d67421e514 100644 GIT binary patch literal 1124 zcmV-q1e^PbP)4$9gQP}7BA^5T1DF_mFd83_YPd+K2&55&Dh6C22voN1{{O${;zL`k!d470$z;yM zocSha&Y3xIBQj$}7;9Re({HMo)R#<-@EId?;mFYk|PziJa`$4{8?LFH7n7bP` z)&EbxyaNe5Sq{$2SgWuozyN~ag2aJVls}u2qF-sQvDXin_x%`x>!w3uV{p<-C~fVVJ5CktZ0m?gzp7aawN;7Ss@Wqh z7e*bqyF4DWF$ zhY<}*#||F9bfRildD)VN5uHmKM&#`X7c-&#;pYp57##)kUH&3ZUjw@u|3Is)xHdX# z#qP>(U!ChsM)D|4A0AOB+b<18=@66qJU`&G#XUAuFQRqmcloJt^S>zV%&K$O@E0I_ z?V}@^_qP2s9LGk{YB4RdfA721|9r{!u7iWmK;0S-Td)!AQy>8biN@Tnk5^1OSywZp zG+7uiL8!d57yZog<^z$I1L-n62jDBj&O#iYz4P+4it!s#h}r-&0$D84UO$IG=MZ#h zS?cn|OppjW{0K46!xcefEjVw``t<4k;oK{$n)hL3qemEQ#@Gh5RTvY;n!PyYVU$hc z*a-+;XIGHWIUU6n7wnH1c@o!OOY5QzCTxWCj(%tOXcO#eg6elY3Y`sz%)#2Arya|F zE=4AjUYG^o{tu#b2jdVKjdt2O`s|*+6I>5%3kDcCqnn$7r9c2S2C^IN%;3axXJ9+j zUVuZ3ufCu)tD$Y#bxgETZx6;g`+!jh`v_8xb81nR$*;oKD{pYdmN)g-ij^f)zqOSi qs|%Sm2e_F-y$^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BDU5Ld*rZws8JGUTETm0`yHyCG{@XRD znC-4BtoIs6sj-l8QOrC5uf7U+4Hi;ZmfGlap$@9Sfzy4Kh}_mm)>ai_ZBd~jnQ?S> z2#I#Mfg10Xu8Ivf00;yRL2B)FNUODy8oS06GmEF@>l_=u(mTRGY;>_Q>QIq%a83X` zTgJH0+q$S4kfzKFJOEd|0#a(Mqy-ymtS&d|p_^)sKuausM}b7=2S(|RpHi7rfXDkN zDgqCXEZq!Tsg3k>w#wjdtvLrY#Nt#b5>;QL4bW>EZ=vb{SJo4F08aInu)f+x+IC2< z_8VYdGZFe$H4^^PXQn$&INg0zooPz~3-G2S7qgSr|ugc1X7fE#9~ zo~i@uB-hDnE3g2G=Tac?teq6hkysG&(B6JYpIszE)}2MdpL=No$h9}rR2^JX9{3Wh zJ;R2zKaE3z&z~cNW@h1ChqSgRzSQ|B_l!Fvu@Ws$|J4=6mpRLo{UbBa`&g*cQ8lpq zzypA10mPlwKwSAaDgKlCPJCMpQiXF1FI(e3QcTQtu3_MB>YSlrhi=gum3VxGPi#dx zvyJHWvbW*2A03o(<+Zv%c0rOGp@EmOE|`2{%gFIBL09E(v4&P6%w_9&BPRQ7OQ!Z@oCsGGHG`fagRz;rS!GVP#PwunX?k)NcR? zFZ>i%9Cp$W&u)ItzYDxm8(tuXXA7LO%vD~ATzJdEq{&+4$0000YdQ@0+Q*UN;cVTj6003CSD=#nC l%goCzPEIUH)ypqR2LLwM23T}G8<+q9002ovPDHLkV1fd2G^zjq literal 0 HcmV?d00001 diff --git a/src/app/share/resources/theme.qrc b/src/app/share/resources/theme.qrc index efa266e2b..7a3862edc 100644 --- a/src/app/share/resources/theme.qrc +++ b/src/app/share/resources/theme.qrc @@ -43,5 +43,11 @@ icons/win.icon.theme/16x16/actions/go-down.png icons/win.icon.theme/24x24/actions/go-down.png icons/win.icon.theme/32x32/actions/go-down.png + icons/win.icon.theme/16x16/actions/zoom-fit-best.png + icons/win.icon.theme/16x16/actions/zoom-original.png + icons/win.icon.theme/24x24/actions/zoom-fit-best.png + icons/win.icon.theme/24x24/actions/zoom-original.png + icons/win.icon.theme/32x32/actions/zoom-fit-best.png + icons/win.icon.theme/32x32/actions/zoom-original.png diff --git a/src/app/widgets/vgraphicssimpletextitem.cpp b/src/app/widgets/vgraphicssimpletextitem.cpp index 62076f3d5..34012b5d7 100644 --- a/src/app/widgets/vgraphicssimpletextitem.cpp +++ b/src/app/widgets/vgraphicssimpletextitem.cpp @@ -43,7 +43,7 @@ VGraphicsSimpleTextItem::VGraphicsSimpleTextItem(QGraphicsItem * parent) this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); this->setAcceptHoverEvents(true); QFont font = this->font(); - font.setPointSize(font.pointSize()+3); + font.setPointSize(font.pointSize()+20); fontSize = font.pointSize(); this->setFont(font); } diff --git a/src/app/widgets/vmaingraphicsview.cpp b/src/app/widgets/vmaingraphicsview.cpp index b59ba8114..1e597d23c 100644 --- a/src/app/widgets/vmaingraphicsview.cpp +++ b/src/app/widgets/vmaingraphicsview.cpp @@ -158,6 +158,33 @@ void VMainGraphicsView::ZoomOut() emit NewFactor(1.0/1.1); } +//--------------------------------------------------------------------------------------------------------------------- +void VMainGraphicsView::ZoomOriginal() +{ + QTransform trans = this->transform(); + trans.setMatrix(1.0, trans.m12(), trans.m13(), trans.m21(), 1.0, trans.m23(), trans.m31(), trans.m32(), + trans.m33()); + this->setTransform(trans); + VAbstractTool::NewSceneRect(this->scene(), this); + emit NewFactor(1.0); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VMainGraphicsView::ZoomFitBest() +{ + QRectF rect = this->scene()->itemsBoundingRect(); + + if (rect.isEmpty()) + { + return; + } + + this->fitInView(rect,Qt::KeepAspectRatio); + VAbstractTool::NewSceneRect(this->scene(), this); + QTransform trans = this->transform(); + emit NewFactor(trans.m11()); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief mousePressEvent handle mouse press events. diff --git a/src/app/widgets/vmaingraphicsview.h b/src/app/widgets/vmaingraphicsview.h index c275ab525..d67981bf9 100644 --- a/src/app/widgets/vmaingraphicsview.h +++ b/src/app/widgets/vmaingraphicsview.h @@ -52,6 +52,8 @@ public slots: void animFinished(); void ZoomIn(); void ZoomOut(); + void ZoomOriginal(); + void ZoomFitBest(); protected: void wheelEvent ( QWheelEvent * event ); void mousePressEvent(QMouseEvent *mousePress);