From 2621ce4ef7b10a810495c291a64bbc11b25fc0b7 Mon Sep 17 00:00:00 2001 From: Flynn Date: Fri, 27 Jun 2014 23:05:31 -0700 Subject: [PATCH] Added tox-style videoButton --- ui/videoButton/videoButton.css | 68 ++++++++++++++++++++ ui/videoButton/videoButton.png | Bin 0 -> 636 bytes ui/videoButton/videoButton.xcf | Bin 0 -> 11833 bytes ui/videoButton/videoButtonDisabled.png | Bin 0 -> 597 bytes ui/videoButton/videoButtonHover.png | Bin 0 -> 613 bytes ui/videoButton/videoButtonPressed.png | Bin 0 -> 617 bytes ui/videoButton/videoButtonRed.png | Bin 0 -> 571 bytes ui/videoButton/videoButtonRedHover.png | Bin 0 -> 574 bytes ui/videoButton/videoButtonRedPressed.png | Bin 0 -> 574 bytes ui/videoButton/videoButtonYellow.png | Bin 0 -> 577 bytes ui/videoButton/videoButtonYellowHover.png | Bin 0 -> 573 bytes ui/videoButton/videoButtonYellowPressed.png | Bin 0 -> 572 bytes widget/form/chatform.cpp | 15 ++++- widget/form/chatform.h | 2 +- widget/form/groupchatform.cpp | 18 ++++-- 15 files changed, 93 insertions(+), 10 deletions(-) create mode 100644 ui/videoButton/videoButton.css create mode 100644 ui/videoButton/videoButton.png create mode 100644 ui/videoButton/videoButton.xcf create mode 100644 ui/videoButton/videoButtonDisabled.png create mode 100644 ui/videoButton/videoButtonHover.png create mode 100644 ui/videoButton/videoButtonPressed.png create mode 100644 ui/videoButton/videoButtonRed.png create mode 100644 ui/videoButton/videoButtonRedHover.png create mode 100644 ui/videoButton/videoButtonRedPressed.png create mode 100644 ui/videoButton/videoButtonYellow.png create mode 100644 ui/videoButton/videoButtonYellowHover.png create mode 100644 ui/videoButton/videoButtonYellowPressed.png diff --git a/ui/videoButton/videoButton.css b/ui/videoButton/videoButton.css new file mode 100644 index 000000000..602ee94ed --- /dev/null +++ b/ui/videoButton/videoButton.css @@ -0,0 +1,68 @@ +QPushButton#green +{ + background-color: transparent; + background-image: url("ui/videoButton/videoButton.png"); + background-repeat: none; + border: none; + width: 50px; + height: 40px; +} + +QPushButton#green:hover +{ + background-image: url("ui/videoButton/videoButtonHover.png"); +} + +QPushButton#green:pressed +{ + background-image: url("ui/videoButton/videoButtonPressed.png"); +} + +QPushButton#red +{ + background-color: transparent; + background-image: url("ui/videoButton/videoButtonRed.png"); + background-repeat: none; + border: none; + width: 50px; + height: 40px; +} +QPushButton#red:hover +{ + background-image: url("ui/videoButton/videoButtonRedHover.png"); +} + +QPushButton#red:pressed +{ + background-image: url("ui/videoButton/videoButtonRedPressed.png"); +} + +QPushButton#yellow +{ + background-color: transparent; + background-image: url("ui/videoButton/videoButtonYellow.png"); + background-repeat: none; + border: none; + width: 50px; + height: 40px; +} +QPushButton#yellow:hover +{ + background-image: url("ui/videoButton/videoButtonYellowHover.png"); +} + +QPushButton#yellow:pressed +{ + background-image: url("ui/videoButton/videoButtonYellowPressed.png"); +} + +QPushButton#grey +{ + background-color: transparent; + background-image: url("ui/videoButton/videoButtonDisabled.png"); + background-repeat: none; + border: none; + width: 50px; + height: 40px; +} + diff --git a/ui/videoButton/videoButton.png b/ui/videoButton/videoButton.png new file mode 100644 index 0000000000000000000000000000000000000000..1003411f409ec20255856929af2eb3433c9e2337 GIT binary patch literal 636 zcmV-?0)zdDP)gdrD?& z_2_RT;Jvcv;o9pv%YrDrUb75jz<;Kd`|S_$)%n%;5luL#k+rrVRs=}i$fJLoW@TeZO=mYu zgRkpf7+reK{Q76|MqVut6O&Xf$*aT!@6!5zYrO{oS^JqqPfhP?hRT4MY?ISjb z4RV4&a#g^QlfY~hfXqs)iI3unm1c-KYL4Cj;*nsqr&R1Aii1VvAgr_h`BO^e@$_#x W#+N}Z5N{{|0000O=`>V+h?u@MSJm;SG=uwDt>$e zuWNpApyNh*VSFuK7Q9yD^^c7)-S-c;|9ZTCeFe#N^XOxJIAM{%iU#>&)ITfG}n>i#p!ZS zSxf+H7pF!p3>8eI zMH*V9p+#CK=?$i?G|P;YD_s>n^+np2=EG;w)-=zRD?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}p!_Wd$w3W~SMB~b``MfSjI;W%Q@O(Q=cAcnWdfsKdQksdJcjy8yH?Zfeggi zdc5{HKT+>Fe~m*9%GseO4>{tx9A3!bg&ba?cp-R3)E3u~cGcqHU50nrvwgs7em4 zk#kffsV96byHq8^FRk*b2Jc#J67d*AWQW%+_FBB+zw|13&ujPcbrX7(M7@xOa(Cz= zKo;*6?L1w}Rt_v)(s%WIvSX!gQon9l)fgDM&n;g%|J<^L?m_p7qOPK-tEf<-sH-S@ z=CAd-8hIgVi}E+0j9R1ooqAmz2gBx1|98|96+={3pMpSHRgS$7H5n)>tI~VVM5FR1 zDy!TZTP3FE^9PAgR&TZkC@byM4mn3HTM-s=>Qfn?XEg1H)6hkcIeA ruc}X?_9)*~p{mk$M^ROjxkHx#RTb4Y+gGA|B?=e+k4pL5J!t(eJ~G|& literal 0 HcmV?d00001 diff --git a/ui/videoButton/videoButtonDisabled.png b/ui/videoButton/videoButtonDisabled.png new file mode 100644 index 0000000000000000000000000000000000000000..af801d30210bfc12d1682fdf4d567da4cabfa26f GIT binary patch literal 597 zcmV-b0;>IqP)uUdS+v2cQAm19x1nxHrO0*MBPRf{YNjXKn%rH=VvCx4tQEO~|f>;uf~-x>v5eJH1zT3O6Dj z#0T*~J_$(hqc)C2B9uxcG)+TM-gjS)<1nAkX|-Cc*Xxgek!&`L5aN$9xm?Z@1b`5N zL?S_`xQcvN~NgR>m-v&`F$i1 z2oMYg1O(rg;@+cs7V-S#-NymdoXvG5h`g>{oUi=Q1GecKfd}lgWh5W`nA#p7yqFoAG$; z-Ny{WaJT{aKH`J;AfE{2`35+i72xRxK%NxbiI3!Jo@R(YkaP3~(9w1M>#5iq{2nYy j2jQNbSHEmBkEeeD8h)9AUl&b500000NkvXXu0mjfSj+@S literal 0 HcmV?d00001 diff --git a/ui/videoButton/videoButtonHover.png b/ui/videoButton/videoButtonHover.png new file mode 100644 index 0000000000000000000000000000000000000000..aeb364120dea18862b9fa090e45b8fb89035f22b GIT binary patch literal 613 zcmV-r0-F7aP)Q;OW&k9poBc4~h=oq1~stNgzE8Kcr-Vj;ovZ64hrE5C9 z^?kG(9wK{7EF|XsDg}8%h&%B}ZMng~!$G>-JuD<<`F0TDcgj+?Ydvr^Fw{28%g#|c z3{Ot~6n)ofuYE*oO&jl4->N@Hq|nerxib)p0wk4A@pV7Uj`c%Lk7P0#;=eZdy#0~* z(I&?y$LfJ3terb=z5fMr_~($we)!U1s0_&R!53z>Ke1=+k|up=O!6do^HMDo$aL&O z&X{%cJ7&_v(2cws#+td3cTQq*ek?-?$eAM!hy!wuK&%qrup|&I0g$M~-uNi4PT7 literal 0 HcmV?d00001 diff --git a/ui/videoButton/videoButtonPressed.png b/ui/videoButton/videoButtonPressed.png new file mode 100644 index 0000000000000000000000000000000000000000..64bf78c3952ad0df46ddca83843ed90c25735c5b GIT binary patch literal 617 zcmV-v0+#)WP)bu``v815CxYdJ0%c=Ed3SjuW0{6>8cQgP}fmf zYAHr&!4d?&V9f= zR|`Nq5lOzT9%v50T_6q&AxkMBmWU(`q$)z0J^E;?+h^HAFfYnjRz+fyBEdZ*^72cijJ1V8Tp_nEY{$YJGBrrC8S$Zpfj(DuwDAgn%q#-7|)ow9oC&`vGGCflC6fu4*^KpHKje>#w z)0PEd>Lz>pJEXGzxAk5KB;z$$-28gtFcbsw#s0vjm05NRyBu+H8CC3qe|}|qyG~|* zzcPtcFi(X5SkJGL@zg#TwTi}Ce!2Fz=ydqVZNDyv3*v%^0x2~BM@a$c1^`JboQ;og z#j88Sd1S8M08)uaa=2>t7{3>b;vk&6^T(f!u4^P)xlpW0mw;2 zK~z}7?U}t!!cZ87pB`HqYUF1#EQCd47>EP1vU&k97)MD=T=gpS4$2j912{Qh49W@# z3&e%65D3v$egp@KF_Eamh@9GYJZakV^nCC4o#a(`r)D;L24sL3V6eKn2l8Rlyqqm4 z4nPFR1N+FOJ0KG_%?IHu$OwV6=RAPol+y)r>s&aVkX;$!7+ZG5#EN&P@5&IkL>`C- z;(`1V5cSvokYTWyPUA}?K>hw_hK&Z@T#lD^`}a>okHt_l?ek~i@r5A(v}hC~m0C_| z1&@#MA044ZA|U3!Vl5C@7~<_puItMwEyd@|o#CVik)YOF>oT@rVcp**G{r z-`m5wzUH}HW^7sVb}e;l3;*FE!IKm8-Q6$!v-0hCeS4eG=_y(?>Vi32Qq54{=D`62xQ#rVc*=$ABM7kJeSKnUR_PS zFdonMi*2tyNH>@J@|k|EhSBM;778ugFb37?;@75THaqd!uLt6Rcpy@NST5kO1W<7S zNJZczK9Vax%MeS*8NC7Ag-tU#Gkb<S->P)Tn=v}vIcWRRYB9-f#?X3 z*=R(+T4nO^An9Zuj~O-^ScL+^MuXX4ARoxM)%tVm{SwHu+ofNrEFXrlfDCFi9*afB z%_dBz%lpN$oDb5uynOeW;r%_6P6tmgxUyjk@9tK=HZ=`n=Gw0d;)1v!Qi1f=fTJgX z+cf~W71)W7V5ZvfX}(>z)?~o_j#(jkj(M)6Z!s*yf$Er{Qv*} M07*qoM6N<$f*H*L3jhEB literal 0 HcmV?d00001 diff --git a/ui/videoButton/videoButtonRedPressed.png b/ui/videoButton/videoButtonRedPressed.png new file mode 100644 index 0000000000000000000000000000000000000000..4fbaac701aee3c94e4330df49045aff28551ad14 GIT binary patch literal 574 zcmV-E0>S->P)5C`O+ zfOvjwhcpe}&JJoKff)>bd7i&iqMgk$xV!uP6H!-I!1MVYsH>|JLjZK*akTC2>6Dhf zyNjMm;aOY+W&AJPfxyHNuTOGSola@BLm>!-SXf@hIzQ*(?Cf1BJiFa;JYq&75Q*Sl zU&lH=#wwQ?^m=m5-i^f|7Qi`K2QJV z1_p!iA5HmmzGe1yHaj%*M-YH@ae>}!eyd?TRjZS~&+5tKv(tVZ5C_Bo5e0HT2OReb zP?-aeih`Z^2v=s5A)X*JdILC(8phVh>}iI1r;P)?A_b! zMt_i@nCwXs;=4cThHX73dy+(SgCm^IH^QJrl3eQt(hX1E-Fp8CB#y4|oZUxpb@?P)aYkAAB$gk{TtF_-=A?^Ic5I5D7nc1|KkS-bb8IIbZTTq9%UpkY0E}LS!CDFZ%w^t@p1$`f;0%e|qmSGzO#-d?aYS z*R#;Szuo%5{DZWw>Lb7DhM#fcA4toa*f6@?Pm|mJWph7C?KcHUK~fN-K>P*Z@Fmb# z0FZ`6Cq9O&Hp~z|U}p3Na9k`^pAUzk}@P)Bc~^_Z{>p^hKOS9-<4u2BDj{ z3DOEJ(ojlE+jKHBH`9d^P)xN^5_97G%gfy1e%$l_XPBe-PDkDPE1(I~fIRc7HsDpN zt+%5El>j^fJYW-9+5?)EYU_(m79>KDoY@0VNjbeiwqEPR6VlbxiLs@trsq7J?yJ0J zL6m}|ASuXy0+N~Dn+p^QJE-gvlydIB&mM4f<}tMA)4vguuYz)a`HX8eCWioU9+O+z znoVgHiwz1Z&v9}Oi5Y)TZAz0vj6TVo>}*OaQbn};l#*G;H~S3w?Vn0P#Y&DxtXjn^ zZDX=Ef}8jFgHI4$2~Mrd1Ki>Zmdg!HcKx^hnfv&SGaKZ}FEQ?#{63 zMZhp<6NNpQojr~%+J2^gxl0%vL+nFN8c1|P_>ZIauRyfDVBmio+YH5k*kGUQ%UzsetObjectName("green"); callButton->setStyleSheet(callButtonStylesheet); - + QString videoButtonStylesheet = ""; + try + { + QFile f("ui/videoButton/videoButton.css"); + f.open(QFile::ReadOnly | QFile::Text); + QTextStream videoButtonStylesheetStream(&f); + videoButtonStylesheet = videoButtonStylesheetStream.readAll(); + } + catch (int e) {} + videoButton->setObjectName("green"); + videoButton->setStyleSheet(videoButtonStylesheet); main->setLayout(mainLayout); mainLayout->addWidget(chatArea); @@ -110,6 +120,7 @@ ChatForm::ChatForm(Friend* chatFriend) headLayout->addLayout(headTextLayout); headLayout->addStretch(); headLayout->addWidget(callButton); + headLayout->addWidget(videoButton); headTextLayout->addStretch(); headTextLayout->addWidget(name); diff --git a/widget/form/chatform.h b/widget/form/chatform.h index 3c4872adf..3f95e6536 100644 --- a/widget/form/chatform.h +++ b/widget/form/chatform.h @@ -72,7 +72,7 @@ private: QGridLayout *mainChatLayout; QLabel *avatar, *name, *statusMessage; ChatTextEdit *msgEdit; - QPushButton *sendButton, *fileButton, *emoteButton, *callButton; + QPushButton *sendButton, *fileButton, *emoteButton, *callButton, *videoButton; QScrollArea *chatArea; QWidget *main, *head, *chatAreaWidget; QString previousName; diff --git a/widget/form/groupchatform.cpp b/widget/form/groupchatform.cpp index b31006d0c..236c9fce6 100644 --- a/widget/form/groupchatform.cpp +++ b/widget/form/groupchatform.cpp @@ -45,13 +45,17 @@ GroupChatForm::GroupChatForm(Group* chatGroup) mainChatLayout->setColumnStretch(1,1); mainChatLayout->setHorizontalSpacing(10); - sendButton->setIcon(QIcon("img/button icons/sendmessage_2x.png")); - sendButton->setIconSize(QSize(32,32)); - sendButton->setFlat(true); - QPalette pal; - pal.setColor(QPalette::Button, QColor(107,194,96)); // Tox Green - sendButton->setPalette(pal); - sendButton->setAutoFillBackground(true); + QString sendButtonStylesheet = ""; + try + { + QFile f("ui/sendButton/sendButton.css"); + f.open(QFile::ReadOnly | QFile::Text); + QTextStream sendButtonStylesheetStream(&f); + sendButtonStylesheet = sendButtonStylesheetStream.readAll(); + } + catch (int e) {} + sendButton->setStyleSheet(sendButtonStylesheet); + msgEdit->setFixedHeight(50); sendButton->setFixedSize(50, 50);