From d3dfffcc5990a1245601b3bd5eaab442e25d4860 Mon Sep 17 00:00:00 2001 From: Jeremy Hu Date: Wed, 14 Mar 2018 10:55:59 +0800 Subject: [PATCH] Fix turnaround resize --- convertresources.sh | 12 +++++- resources.qrc | 16 ++++++-- resources/clip.png | Bin 0 -> 1953 bytes resources/delete.png | Bin 0 -> 1371 bytes resources/down.png | Bin 0 -> 1181 bytes resources/info.png | Bin 0 -> 1254 bytes resources/new.png | Bin 0 -> 1512 bytes resources/palette.png | Bin 0 -> 1732 bytes resources/rangeselect.png | Bin 0 -> 1568 bytes resources/save.png | Bin 0 -> 1889 bytes resources/trashbin.png | Bin 0 -> 1591 bytes resources/up.png | Bin 0 -> 1183 bytes src/main.cpp | 2 +- src/mainwindow.cpp | 65 +++++++++++++++++++++++-------- src/mainwindow.h | 4 ++ src/skeletoneditgraphicsview.cpp | 39 +++++++++++++++++++ src/skeletoneditgraphicsview.h | 4 ++ src/skeletoneditnodeitem.cpp | 15 +++++++ src/skeletoneditnodeitem.h | 2 + src/theme.cpp | 4 +- 20 files changed, 140 insertions(+), 23 deletions(-) create mode 100644 resources/clip.png create mode 100644 resources/delete.png create mode 100644 resources/down.png create mode 100644 resources/info.png create mode 100644 resources/new.png create mode 100644 resources/palette.png create mode 100644 resources/rangeselect.png create mode 100644 resources/save.png create mode 100644 resources/trashbin.png create mode 100644 resources/up.png diff --git a/convertresources.sh b/convertresources.sh index b26144fc..d81686d8 100644 --- a/convertresources.sh +++ b/convertresources.sh @@ -1,3 +1,13 @@ convert thirdparty/capicon/png/white/059.png -fuzz 90% -fill 'rgb(252,102,33)' -opaque 'rgb(255,255,255)' resources/add.png convert thirdparty/capicon/png/white/262.png -fuzz 90% -fill 'rgb(252,102,33)' -opaque 'rgb(255,255,255)' resources/select.png -convert thirdparty/capicon/png/white/078.png -fuzz 90% -fill 'rgb(252,102,33)' -opaque 'rgb(255,255,255)' resources/picture.png \ No newline at end of file +convert thirdparty/capicon/png/white/078.png -fuzz 90% -fill 'rgb(252,102,33)' -opaque 'rgb(255,255,255)' resources/picture.png +convert thirdparty/capicon/png/white/226.png -fuzz 90% -fill 'rgb(252,102,33)' -opaque 'rgb(255,255,255)' resources/save.png +convert thirdparty/capicon/png/white/341.png -fuzz 90% -fill 'rgb(252,102,33)' -opaque 'rgb(255,255,255)' resources/info.png +convert thirdparty/capicon/png/white/279.png -fuzz 90% -fill 'rgb(252,102,33)' -opaque 'rgb(255,255,255)' resources/up.png +convert thirdparty/capicon/png/white/278.png -fuzz 90% -fill 'rgb(252,102,33)' -opaque 'rgb(255,255,255)' resources/down.png +convert thirdparty/capicon/png/white/274.png -fuzz 90% -fill 'rgb(252,102,33)' -opaque 'rgb(255,255,255)' resources/clip.png +convert thirdparty/capicon/png/white/254.png -fuzz 90% -fill 'rgb(252,102,33)' -opaque 'rgb(255,255,255)' resources/rangeselect.png +convert thirdparty/capicon/png/white/057.png -fuzz 90% -fill 'rgb(252,102,33)' -opaque 'rgb(255,255,255)' resources/delete.png +convert thirdparty/capicon/png/white/047.png -fuzz 90% -fill 'rgb(252,102,33)' -opaque 'rgb(255,255,255)' resources/new.png +convert thirdparty/capicon/png/white/039.png -fuzz 90% -fill 'rgb(252,102,33)' -opaque 'rgb(255,255,255)' resources/palette.png +convert thirdparty/capicon/png/white/030.png -fuzz 90% -fill 'rgb(252,102,33)' -opaque 'rgb(255,255,255)' resources/trashbin.png diff --git a/resources.qrc b/resources.qrc index ba898fd9..e5054d68 100644 --- a/resources.qrc +++ b/resources.qrc @@ -1,7 +1,17 @@ - resources/add.png - resources/select.png - resources/picture.png + resources/add.png + resources/select.png + resources/picture.png + resources/save.png + resources/info.png + resources/up.png + resources/down.png + resources/clip.png + resources/rangeselect.png + resources/delete.png + resources/new.png + resources/palette.png + resources/trashbin.png \ No newline at end of file diff --git a/resources/clip.png b/resources/clip.png new file mode 100644 index 0000000000000000000000000000000000000000..6a7cb5eaf4d0ce1ea1c4f1c017e883fe1d42cbda GIT binary patch literal 1953 zcmeAS@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+rOTywDQ_!zUxi; zm-9!Hf7M3KKR>znUF)5ST|SC6n;9;9Up&yeBwkJO2_6}XY zJr!q}?;3^OZ;qOMzoY8c_H%n4#MWQ8%6zxBuHfG9F8(_m+Fs{os_Wk=~;o>_x zrk>k-f}!l+{93KNpA#%r3O%@3e=+@6k*)r!M*Tk953;or*NLBvXKa6MsCVR}^P-h( z3)Fty56Rs?z*G1>;89|Ce$;&>+kkHmauynFbAoYxJHzu zB$lLFB^RXvDF!10LknF4V_iez5JO8V6GJN#Q*8qaD+7ZWu2t?R8glbfGSezS8ccKz z40R1HLW~Toj18?!p&D#HB+LYAkObKfoS#-wo>-L1;Fyx1l&avFo0y&&l$w}QS$HxP RSZ^{gc)I$ztaD0e0swMqt=Iqn literal 0 HcmV?d00001 diff --git a/resources/delete.png b/resources/delete.png new file mode 100644 index 0000000000000000000000000000000000000000..23c99297b4df21e8ef3a8f2e8a973f78760fdd1c GIT binary patch literal 1371 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sEa{HEjtmSN`?>!lvI6-E$sR$z z3=CCj3=9n|3=F@3LJcn%7)pT}UnMXwSj}Ky5HFasE6|34fpJEFPl)UP|NsA_DFP9k zfy@R9!o}eXh&cRer7Fn4=IoQGja3T zwVYl@#mv4c9C&CT`S?eU#h2h?H|ICZS;F%^o9VFf4Ax)UoS)v)wtvR8Td^tkyUrGF z*9X4mwny{`Tzeh9=yq~t%#rpmmA}(IcbU8}f4NWTmWcj}S5sG>uuRwRe=|i`CQrKM zs>jhxpo;Ks_5GUroQ(SWwyoWkz3r-jI@h9eKeKPg z8J;h{AbKl^;g9z|hqK+9<##GQpDC8zoc>}_Ub%nfmD}wfUTXg{P4#(|zFugx{KNHM zKcq^1;Hszx@O=rzfA}{Ky-8`PPA+J?(FD{LcEHPfR^^KbY;^lyEGe32Bl_cx@rBowhaNHM@6r6cw9`#YoTrAJb5qLW z{7n5#4x69v)8dWS7Rrw}@cYBQ(&O)CObq;fKK*{>S3seZozfqX>VxW8yc=uR)=Xnw zU2^GHP~o+jrP22VesavtUex+{-S1~o=V!;?ymD>f=Dla+(-Pac-&7gjk5S&I{`K_t zEyr)$+w9LI-#$A2U3=K#}*YKdz^NlIc#s#S7PDv)9@GBC8zH89pS zG!8Mev@$WYGBMRQu&^>PnBiLGj-nwqKP5A*5~RUI*T7KM&@jZv(8|!z%Gd;=fhCg% zR4Ph>YzWRzD=AMbN@Z|N$xljE@XSq2PYp^ literal 0 HcmV?d00001 diff --git a/resources/down.png b/resources/down.png new file mode 100644 index 0000000000000000000000000000000000000000..de1a34697e7d07ef7033fc95e08ac794f736ff8a GIT binary patch literal 1181 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sEa{HEjtmSN`?>!lvI6-E$sR$z z3=CCj3=9n|3=F@3LJcn%7)pT}UnMXwSj}Ky5HFasE6|34fiWq-C&cyt|Nno|6d?$W z4dEh_aFv+qk)@E$K^DiQ3%`0?CJ>_ws0OYK&cHMfzX)6-oPl3GvMf+b*_%V4XecQO z@(X5&xjmCv`FcMqdynWYu6=1IHvY6>T+{fZqVv@bCbvKT!fO;>e^uwa=y>+ibBXz9 z!g5|rY_@)@yVvFEM{|)oEC(Gv@97Jy)%s$$K#c!}E!*06^>v0SzM;=PSUphnyDFV| zT&R6J_mZWXCS@o+{uXSec1}id>O47J9iaV;N#5=*3>~bp9zYIziKnkC`#nY>5e3DE zL2=wb>B*ihjv*e$-(I;McE~}1?SbHi#?B@UEe@}Z3SFYEZ&=rKh*rNBExq^OLuk|P z2~77Y_B_~s%4eVLhTY5zPyfsgk?2{bv}Dt&U2b*jOqCWz-jC+#D4p}=%twtSap#M9 znI0Y$Ra^by;RSHziW;+=BWF4$5qxhSJs`-{?eA2yyQavtq6ND z!P(0SclCDG$aih3Gn$s|?|b?DncK(C=)C@0{KPe7UWxdPT%D|n237u-`j_(}E*o#} z&-vL&OGvdYCCo0>2J+8iBVzAK<&13WDHmB(Y%sj1q;pEms_wT%_ z+;Cs?$8VJv>OUtumyZq5xfDO4Xx$cP{R@9Xy4Wk~CjNOHooQG7l&_HOzV}xK`OG6{ z(qGCw(Efb(@3HBhpZ{d!C#5QQ<|d}62BjvZR2H601(q2M44$rjF6*2UngG;oAa4Kw literal 0 HcmV?d00001 diff --git a/resources/info.png b/resources/info.png new file mode 100644 index 0000000000000000000000000000000000000000..7121282a34810ca229fbfb35abb588d844ecd8e5 GIT binary patch literal 1254 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sEa{HEjtmSN`?>!lvI6-E$sR$z z3=CCj3=9n|3=F@3LJcn%7)pT}UnMXwSj}Ky5HFasE6|34fw3XLC&cyt|Nno|6fqI9 zI4(A(E{F&o^*||zES!PM5HxX!F1R2X7buP?0#}U2AYLW1Mr2*cY-BZ9*~p5K*+9iW zZnxZaA7CWal?3?(GdRq;^Znb!I&Q@+w?uVcFXy@UweZJ|U3>o7Rh6#9|>99-zfI?ZjfP{Urbi!uO}|o^7-sv7I8M7S*Wl_V=~Ysj7i?^ zE({&4vK~MVdx@v7EBif0AyFBFpOj*3id$hJxU}2n4&H@!vlTSPLavo8>@+RZt zzTVASc~2Byy!Wta(YkXs^G>^lmpjJQ`0F35&9k`w{^6y^vJIb_omCbdcBnhz{KHM+ z-R7^K)Xlga9Y5CEG@~Kqnmk9Bs0rr-XTOz?mMxq4#8{_k)_?wi$=YSRT*SD2nc6kSIItw~jTb<-6DG zRg+E6JYA~m*Ro)T%+=uACJHGh&+Dt$d{Me1+G1O@fBxU2%v|rq&Oe;6`>VX`j#Z0l zP+zUok~ko?Zj`%RIJ+m~rZ znreI~-;&Jz@A><{I43pVrxy>)+x_r(K2ddgeV0+i7oFpi4Zqd*h~Ko%jGtLyCX{cJ zSO34^!_95K|8%8qxv#lZ?>FNlF^TuC`#LrOqg1uTHKHUXu_Vlzw|7+PAH7+RT_Y8zNs85qoPt#U`vkei>9nN|tXV4`basB35uVq|D#WMO4u0nt#{ zpaV)Yk{}y`^V3So6N^$A98>a>QWZRN6Vp?JQWH}u3s0s33m*msPgg&ebxsLQ0NT4k Ap8x;= literal 0 HcmV?d00001 diff --git a/resources/new.png b/resources/new.png new file mode 100644 index 0000000000000000000000000000000000000000..a0678bed00252c6427b10e910c9f1e716e4f6966 GIT binary patch literal 1512 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sEa{HEjtmSN`?>!lvI6-E$sR$z z3=CCj3=9n|3=F@3LJcn%7)pT}UnMXwSj}Ky5HFasE6|34f$?#GPl)UP|NsA_DdItJ z1rP?Di&YDLS!69lsw7ewvdP4=frew6k0yx5CEjqdRifDlaUq%@rr{7}SjBnz7^Q&e zV17xEUogWDo3IZCTY?{|zLvNt#dv`~?eJ&io$H#u9A&Pse_6FM@ZL|urAe1AbIdP3 zvbA?w>tDyIGam4@FV=F2E1$Uf{>r=a}VRokDui_eRCwbp6hWN&xt1AQwtUHhf*{qZ@ulM8yv5_~L_ctm17P1uif z3F#P{`iCZdd;e6tpt@tnp0AJmIo<-D%9!Ns?!wT)D(eB{u$OrHy0YJ6=v;Fjm z+B}Wrb;gEyp3Am0GO?O`C`=FwN>Jv#p`>xkr6H*=RAuBM~Oy;5>umR*+G1ARy9kOSw3P3VKCav%NEGs{`R0@olLN?CR4$l z*7z-Ml}S<3Y;~7)55^qqeA@I)!jgf-O3UhTZ0TKf|Eu5T*d4BUsZ_|n@!q!0&(FnY z?5g0DW#mY{(0fJn=pft<=^%0$L!o-$?$#6flB`G#jKS(q{>+N z*F1Q**hA%0#P#-{=X>JIWIh5vToHnhZS`vn)*ABEKf1| zS(%m=7C1$}xcKwRe}arH6>nF6Jo`{lyy1FDr(#2y`2*1d-&e^n*3bWQVt$a#Rr~tC z(~f_!uV1X_yZXubdrrUjdN%pox6i)Z?45k_b_Os(sg}4#l%yn?kE~^^HVa@DnS}dbPWu34Glw#46O_-t&Gee z8nlZ#*?}4)K{f>Er!lvI6-E$sR$z z3=CCj3=9n|3=F@3LJcn%7)pT}Un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vVgt qNqJ&XDuZK6ep0G}XKrG8YEWuoN@d~6RAAM@z~JfX=d#Wzp$PyhsxsXG literal 0 HcmV?d00001 diff --git a/resources/rangeselect.png b/resources/rangeselect.png new file mode 100644 index 0000000000000000000000000000000000000000..2aacc9b8afc0b1b4c18d20df4987387cac636b52 GIT binary patch literal 1568 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sEa{HEjtmSN`?>!lvI6-E$sR$z z3=CCj3=9n|3=F@3LJcn%7)pT}UnMXwSj}Ky5HFasE6|34f$>LxPl)S(82FQ>h!p|l zv5G?kF=dfO;A}Vps0*2m%Mh$KqG?3tBD1mT#cD6*Dj_DoZHF^RH5tD~xGbE3%X}im zf#$r5Q!@i5j%6i5e!&cEEcFX_Uw!`N!%-2(jJ|Dm{+L|1QR$w`mJUO(I39;vzd@{X-Ol9yiInEH21 zqU^(&)o(gPEnIw0&)>D)W8ca>3QEzLOini?j7#Jz{x#K|*?53cZ~Fb7(z_ej^MVe3 zy>RyXiXTGF{#-J%><_;?zDg@ZI@s%5`I=+rtv)ZBpz}Vx2b2XElf2zs7&=&GJ%Akc z5>H=O_Ir#%B4SLZH23i^FfjRfx;Tb-9KSj>JzUsPq%A&4jI)b{GteWDvy(|n$&6{y ziq43Q3JJVItjt;~JaRHbv^BccZS4N~cka2g;3Gn5`z!jsAHKJ{dS3eZGj}YF5B!&~ zR7;o^d2;StckepCu#$6knkrkbE&AzTI63jRbaYbu0v#Wxr45sWPSv@~`c0RPIO3zj zc4uYPNt11Nf*+pM6`Jq;AbQrb?rDrmr-q7##(fO>E4(iza$-^#lj)OHk8WLMEzQ34 z`O8|>>o2eV;_c%9I@9q-W81M_-~D}M!jT%2iipPVhb&88S6SFme*h2ot24w;_2*UE;%jLe{LAl3&rZxR9)vT z)8d?z;JLZyA2$ddRFi9-bcoe=hlZS@=R+aOmSu{YoZ>bxJTlm+qsgP*qLDdGq>1w( zS7m6>4l{wBe0LPwRakAE%=4#83h}h;R4cnZ;evM=W4T-Nv)x5a5f`c-&DrC>>uHPN zCf_COPn<0u3f@${Bw?91>7l%O|L?@VJLXw#>HX{S#BCz8@V05oZx-I)?8&&xMbtBn z>wKg5Dyi%*I8 z1+2ZE-|)=jlh}&09Cr`wcKK*$m>0a;{>t_L3*~0?)Q3!2`C@s*8)Jd6tNK!lSFL&x zd^hCw_58*6mzE#3?~$Lz&buN~UimFBv8k50MwFx^mZVxG7o`Fz1|tJQ3ta-L1;Fyx1l&avFo0y&&l$w}QS$HxPSZp&ec)I$ztaD0e0su~-)OP>? literal 0 HcmV?d00001 diff --git a/resources/save.png b/resources/save.png new file mode 100644 index 0000000000000000000000000000000000000000..8f905b633e54c16b62ad6898f4ae7d9007a7b179 GIT binary patch literal 1889 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sEa{HEjtmSN`?>!lvI6-E$sR$z z3=CCj3=9n|3=F@3LJcn%7)pT}UnMXwSj}Ky5HFasE6|34fypPpC&cyt|Nno|6fqH2 zaZEu>5uj061<|ZPQ-j7O(hxK=$>Snh4PhgTK+HrFLF1BVFQzWIu|Ni#jjRlpIID}2P1zW2A^)R;mUDo+##nasR({3KQd|>f|J?nlh zY?tk@%TG#tReiy!;?ghC^If{!QmoSJ<2KZ@dEV-8H=O_Ir#% zBHWrYe`*IXFfhw|x;Tb-9PgdhZ6D$&a=cz?rD~;HmEg^eURRB!lf0D9@0q0H>Esdi zG?LR(U&Qu{-_mxWz1jaZy*snx`k8n4&M*J`^Ub;U^NRObZ{D1KPUnOCGY2sXE8UW~ zCyRv3BlozJNpP5lZ(nM5^4)10o4p;|pL|xF^;2*Asqc^L>QC-Wl2c%uRsK}#*S=Z1 zuX`MbV*D`oGb`I#?q$gwojvpzKbWff=vuAp_k|TrAM%Ss)nL3>(bB#8{GECa&Jk`@=+hk95$s4K+njTXa z?0)BI-k+hxQ2k)lsl6r{v(im(tLFttb+9Zkc&Wqq+g0IiR$GD^zlTE`M~hPMRQ61R z?vpv39>R?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_l4meJIrX34fc8L_p8Hy$XAoVL_0GLMVJ&m_cr z`<8iYY_GD-xz=Eut}BcJ13I zWvx(=6Zn8n_q)Q@yGu_Aq{`|@vb}qGkfUJ!G4?CpCTx=MzNJygQu5kSMq=ql!$$Qf zwyB<~szwHBJo5x4mcOZF+pxPfk!Mk4LN(`}MTJZixjaf*0Tm}TZCD<^(z!5CtM`+T zHJ9?Sgh>ZNR)rk(&bjU*%{;xzd+nYn43CaI=;iv<7{qr^s=0+L?Z>8l%xPa21oOYL z{J>OPCGb>XS<@2H8P7K#_#KitquC}QfJ1BZf!SJTKVGt!aHW~k?sdRH_67GPEUunT zJ)m&`Jxbu3agkY^{Vj{o%1Jp~H-1h3c$252XoCie;nyOEU-k~l z`ZpWWY=0a{uVsmuS$ZHziX%+(#rZfrX0D9I_223wUmgm#-B8Qyv~b~4Ri^vu(-(g_ z#dLbg7f&+<274bryVOvIW7o7qo~rwv*Y5hX`rG$g^QX;wa_7|jr-!a4Y4*Pi;60)F276Aviy+q&%@GmBBG3KPgqg eGdD3kH7GSPrLyp3DzG$XVDNPHb6Mw<&;$UR3FFiN literal 0 HcmV?d00001 diff --git a/resources/up.png b/resources/up.png new file mode 100644 index 0000000000000000000000000000000000000000..35dda21a43c3ae8d0e9080355f2a07f79b10dc9c GIT binary patch literal 1183 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sEa{HEjtmSN`?>!lvI6-E$sR$z z3=CCj3=9n|3=F@3LJcn%7)pT}UnMXwSj}Ky5HFasE6|34fiWY%C&cyt|Nno|6d?$i z4HraaU@Cx%5W_$=3J)7@6jn9(Wzn<%6%(%>t4geba9iNAa0Xlo!hnba$q?(xdSGOf zl?3?(Gbo;$%BA*9M&AagqPPE~pQvHpIEiu5QnvPO+?mIO{N8=NDsBEj*ZP6# ztAAly{I}}sUK{S&v382sjZd}?U+kQI*4n@AyZ%Cg<)F*Q3C(Xp_vJj7pMQ$;qT|^f z1$8F3@TMmf-Ft1;@TBc$pV@nNckG?ntdC05?g3rEnB?v5!qCAg>jC7jmw5WRvfpDA z5>Zg+F#K%?l@R(BT{oersk$cVGLH)!Y5&ZjV$s^)8|B zAEW6#&y|kTr7hcRPVKpYI3f%EyqN}1eP72_~ygU!Y3Q7 zKl2EGxnQC>tw-tjl`XFvbd7`b1f2VBtm&EGeR*=_w6BkAEyO-Fh-KQHS@>tt8AosD zf|+UILOVXZnw7+>cStH?`u1rCiS9vjLc5ll6}3O_OFq6#d-Cn1&Ro6g4Az@w@7O)P zPHB>kkHfxiseQ~AHc7lP+Od*?_KNrAI)0)e-=v-E}aLuKQ^0Vcbbmz0l-T}syYKdz^NlIc#s#S7PDv)9@GBC8zH89pSG!8Me zv@$WYGBMRQu&^>PnBiLGj-nwqKP5A*5~RUI*T7KM&?3ahz{=Rj%GeU3;Tp$|OrQoy vkPX54X(i=}MX3yqDfvmM3ZA)%>8U}fi7AzZCsTo?1_OhqtDnm{r-UW|j2Im= literal 0 HcmV?d00001 diff --git a/src/main.cpp b/src/main.cpp index 8aeec1ff..c6464253 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,7 +26,7 @@ int main(int argc, char ** argv) darkPalette.setColor(QPalette::Highlight, QColor(42, 130, 218)); darkPalette.setColor(QPalette::HighlightedText, Qt::black); qApp->setPalette(darkPalette); - qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }"); + qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #fc6621; border: 1px solid white; }"); QCoreApplication::setApplicationName("Dust 3D"); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 626f3a06..3c907d19 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -5,6 +5,8 @@ #include #include #include +#include +#include #include #include "mainwindow.h" #include "skeletoneditwidget.h" @@ -53,28 +55,42 @@ MainWindow::MainWindow() : m_modelingWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); m_modelingWidget->setWindowFlags(Qt::Tool | Qt::Window); m_modelingWidget->setWindowTitle("3D Model"); - - QPushButton *changeTurnaroundButton = new QPushButton(""); - changeTurnaroundButton->setIcon(QIcon(":/resources/picture.png")); - + QVBoxLayout *rightLayout = new QVBoxLayout; rightLayout->addSpacing(10); - rightLayout->addWidget(changeTurnaroundButton); + + //QPushButton *changeTurnaroundButton = new QPushButton(""); + //changeTurnaroundButton->setIcon(QIcon(":/resources/picture.png")); + //changeTurnaroundButton->setToolTip(tr("Change turnaround reference image")); + //rightLayout->addWidget(changeTurnaroundButton); + rightLayout->addStretch(); QToolBar *toolbar = new QToolBar; toolbar->setIconSize(QSize(16, 16)); toolbar->setOrientation(Qt::Vertical); + QAction *addAction = new QAction(tr("Add"), this); addAction->setIcon(QIcon(":/resources/add.png")); + toolbar->addAction(addAction); + QAction *selectAction = new QAction(tr("Select"), this); selectAction->setIcon(QIcon(":/resources/select.png")); - toolbar->addAction(addAction); toolbar->addAction(selectAction); + QAction *rangeSelectAction = new QAction(tr("Range Select"), this); + rangeSelectAction->setIcon(QIcon(":/resources/rangeselect.png")); + toolbar->addAction(rangeSelectAction); + + //m_clipTableWidget = new QTableWidget; + //m_clipTableWidget->setFixedWidth(32); + //m_clipTableWidget->verticalHeader()->setVisible(false); + QVBoxLayout *leftLayout = new QVBoxLayout; leftLayout->addWidget(toolbar); leftLayout->addStretch(); + //leftLayout->addWidget(m_clipTableWidget); + leftLayout->addSpacing(10); QHBoxLayout *middleLayout = new QHBoxLayout; middleLayout->addLayout(leftLayout); @@ -106,22 +122,28 @@ MainWindow::MainWindow() : connectResult = connect(m_skeletonEditWidget, SIGNAL(sizeChanged()), this, SLOT(turnaroundChanged())); assert(connectResult); - connectResult = connect(changeTurnaroundButton, SIGNAL(released()), this, SLOT(changeTurnaround())); + connectResult = connect(m_skeletonEditWidget->graphicsView(), SIGNAL(changeTurnaroundTriggered()), this, SLOT(changeTurnaround())); assert(connectResult); + + //connectResult = connect(clipButton, SIGNAL(clicked()), this, SLOT(saveClip())); + //assert(connectResult); +} + +void MainWindow::showModelingWidgetAtCorner() +{ + if (!m_modelingWidget->isVisible()) { + QPoint pos = QPoint(QApplication::desktop()->width(), + QApplication::desktop()->height()); + m_modelingWidget->move(pos.x() - m_modelingWidget->width(), + pos.y() - m_modelingWidget->height()); + m_modelingWidget->show(); + } } void MainWindow::meshReady() { Mesh *resultMesh = m_skeletonToMesh->takeResultMesh(); - if (resultMesh) { - if (!m_modelingWidget->isVisible()) { - QRect referenceRect = m_skeletonEditWidget->geometry(); - QPoint pos = QPoint(referenceRect.right() - m_modelingWidget->width(), - referenceRect.bottom() - m_modelingWidget->height()); - m_modelingWidget->move(pos.x(), pos.y()); - m_modelingWidget->show(); - } - } + showModelingWidgetAtCorner(); m_modelingWidget->updateMesh(resultMesh); delete m_skeletonToMesh; m_skeletonToMesh = NULL; @@ -196,3 +218,14 @@ void MainWindow::changeTurnaround() m_turnaroundFilename = fileName; turnaroundChanged(); } + +void MainWindow::saveClip() +{ + QImage image = m_modelingWidget->grabFramebuffer(); + //QTableWidgetItem *item = new QTableWidgetItem; + //item->setSizeHint(QSize(32, 32)); + //item->setIcon(QPixmap::fromImage(image.scaled(32, 32))); + //m_clipTableWidget->insertRow(m_clipTableWidget->rowCount()); + //m_clipTableWidget->setItem(m_clipTableWidget->rowCount() - 1, 0, item); + //image.save("/Users/jeremy/Repositories/dust3d/gl.png"); +} diff --git a/src/mainwindow.h b/src/mainwindow.h index 3681d526..bba763dd 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -2,6 +2,8 @@ #define MAIN_WINDOW_H #include #include +#include +#include #include "modelingwidget.h" #include "skeletoneditwidget.h" #include "skeletontomesh.h" @@ -18,6 +20,8 @@ public slots: void turnaroundChanged(); void turnaroundImageReady(); void changeTurnaround(); + void saveClip(); + void showModelingWidgetAtCorner(); private: ModelingWidget *m_modelingWidget; SkeletonEditWidget *m_skeletonEditWidget; diff --git a/src/skeletoneditgraphicsview.cpp b/src/skeletoneditgraphicsview.cpp index ec9a1832..afeb50b2 100644 --- a/src/skeletoneditgraphicsview.cpp +++ b/src/skeletoneditgraphicsview.cpp @@ -35,6 +35,8 @@ SkeletonEditGraphicsView::SkeletonEditGraphicsView(QWidget *parent) : void SkeletonEditGraphicsView::toggleAddNodeMode() { + if (!m_backgroundLoaded) + return; m_inAddNodeMode = !m_inAddNodeMode; applyAddNodeMode(); } @@ -48,12 +50,16 @@ void SkeletonEditGraphicsView::applyAddNodeMode() void SkeletonEditGraphicsView::turnOffAddNodeMode() { + if (!m_backgroundLoaded) + return; m_inAddNodeMode = false; applyAddNodeMode(); } void SkeletonEditGraphicsView::turnOnAddNodeMode() { + if (!m_backgroundLoaded) + return; m_inAddNodeMode = true; applyAddNodeMode(); } @@ -89,6 +95,12 @@ void SkeletonEditGraphicsView::mousePressEvent(QMouseEvent *event) m_lastMousePos = mapToScene(event->pos()); } +void SkeletonEditGraphicsView::mouseDoubleClickEvent(QMouseEvent *event) +{ + QWidget::mouseDoubleClickEvent(event); + emit changeTurnaroundTriggered(); +} + float SkeletonEditGraphicsView::findXForSlave(float x) { return x - m_backgroundItem->boundingRect().width() / 4; @@ -286,11 +298,38 @@ void SkeletonEditGraphicsView::setNextStartNodeItem(SkeletonEditNodeItem *item) void SkeletonEditGraphicsView::updateBackgroundImage(const QImage &image) { + QSizeF oldSceneSize = scene()->sceneRect().size(); QPixmap pixmap = QPixmap::fromImage(image); m_backgroundItem->setPixmap(pixmap); scene()->setSceneRect(pixmap.rect()); + adjustItems(oldSceneSize, scene()->sceneRect().size()); if (!m_backgroundLoaded) { m_backgroundLoaded = true; applyAddNodeMode(); } } + +void SkeletonEditGraphicsView::adjustItems(QSizeF oldSceneSize, QSizeF newSceneSize) +{ + if (oldSceneSize == newSceneSize) + return; + float radiusMul = (float)newSceneSize.height() / oldSceneSize.height(); + float xMul = (float)newSceneSize.width() / oldSceneSize.width(); + float yMul = radiusMul; + QList::iterator it; + QList list = scene()->items(); + for (it = list.begin(); it != list.end(); ++it) { + if ((*it)->data(0).toString() == "node") { + SkeletonEditNodeItem *nodeItem = static_cast(*it); + nodeItem->setRadius(nodeItem->radius() * radiusMul); + QPointF oldOrigin = nodeItem->origin(); + nodeItem->setOrigin(QPointF(oldOrigin.x() * xMul, oldOrigin.y() * yMul)); + } + } + for (it = list.begin(); it != list.end(); ++it) { + if ((*it)->data(0).toString() == "edge") { + SkeletonEditEdgeItem *edgeItem = static_cast(*it); + edgeItem->updatePosition(); + } + } +} diff --git a/src/skeletoneditgraphicsview.h b/src/skeletoneditgraphicsview.h index bfd67c2f..97466bf0 100644 --- a/src/skeletoneditgraphicsview.h +++ b/src/skeletoneditgraphicsview.h @@ -10,6 +10,7 @@ class SkeletonEditGraphicsView : public QGraphicsView Q_OBJECT signals: void nodesChanged(); + void changeTurnaroundTriggered(); public slots: void turnOffAddNodeMode(); void turnOnAddNodeMode(); @@ -21,6 +22,7 @@ protected: void wheelEvent(QWheelEvent *event); void mouseReleaseEvent(QMouseEvent *event); void mousePressEvent(QMouseEvent *event); + void mouseDoubleClickEvent(QMouseEvent *event); private: QGraphicsPixmapItem *m_backgroundItem; QGraphicsEllipseItem *m_pendingNodeItem; @@ -33,6 +35,7 @@ private: QPointF m_lastMousePos; bool m_isMovingNodeItem; bool m_backgroundLoaded; +private: void toggleAddNodeMode(); void applyAddNodeMode(); SkeletonEditNodeItem *findNodeItemByPos(QPointF pos); @@ -41,6 +44,7 @@ private: bool canNodeItemMoveTo(SkeletonEditNodeItem *item, QPointF moveTo); void AddItemRadius(QGraphicsEllipseItem *item, float delta); bool canAddItemRadius(QGraphicsEllipseItem *item, float delta); + void adjustItems(QSizeF oldSceneSize, QSizeF newSceneSize); }; #endif diff --git a/src/skeletoneditnodeitem.cpp b/src/skeletoneditnodeitem.cpp index 54b4e231..6772209e 100644 --- a/src/skeletoneditnodeitem.cpp +++ b/src/skeletoneditnodeitem.cpp @@ -61,6 +61,21 @@ float SkeletonEditNodeItem::radius() return rect().width() / 2; } +void SkeletonEditNodeItem::setRadius(float radius) +{ + QPointF oldOrigin = origin(); + setRect(oldOrigin.x() - radius, oldOrigin.y() - radius, + radius * 2, radius * 2); +} + +void SkeletonEditNodeItem::setOrigin(QPointF point) +{ + QPointF moveBy = point - origin(); + QRectF newRect = rect(); + newRect.adjust(moveBy.x(), moveBy.y(), moveBy.x(), moveBy.y()); + setRect(newRect); +} + void SkeletonEditNodeItem::setHighlighted(bool highlighted) { m_highlighted = highlighted; diff --git a/src/skeletoneditnodeitem.h b/src/skeletoneditnodeitem.h index a74f9878..80f5b1c4 100644 --- a/src/skeletoneditnodeitem.h +++ b/src/skeletoneditnodeitem.h @@ -19,6 +19,8 @@ public: SkeletonEditNodeItem *master(); SkeletonEditNodeItem *slave(); SkeletonEditNodeItem *pair(); + void setRadius(float radius); + void setOrigin(QPointF point); private: bool m_highlighted; bool m_isNextStartNode; diff --git a/src/theme.cpp b/src/theme.cpp index 54c0e88b..27f6d422 100644 --- a/src/theme.cpp +++ b/src/theme.cpp @@ -7,10 +7,10 @@ QColor Theme::skeletonMasterNodeBorderColor = QColor(0xfc, 0x66, 0x21, 128); QColor Theme::skeletonMasterNodeBorderHighlightColor = QColor(0xfc, 0x66, 0x21, 200); QColor Theme::skeletonMasterNodeFillColor = QColor(0xfc, 0x66, 0x21, 50); -int Theme::skeletonMasterNodeBorderSize = 15; +int Theme::skeletonMasterNodeBorderSize = 2; QColor Theme::skeletonSlaveNodeBorderColor = QColor(0xcc, 0xcc, 0xcc, 64); QColor Theme::skeletonSlaveNodeBorderHighlightColor = QColor(0xfc, 0x66, 0x21, 100); QColor Theme::skeletonSlaveNodeFillColor = QColor(0xcc, 0xcc, 0xcc, 25); -int Theme::skeletonSlaveNodeBorderSize = 15; +int Theme::skeletonSlaveNodeBorderSize = 2;