From 290e985c1ca438d19b5c6cc3747999525ec840bf Mon Sep 17 00:00:00 2001 From: Kevin Flynn Date: Mon, 30 Jun 2014 19:12:17 -0700 Subject: [PATCH] Disabled custom window borders, fixed bug where message alert wouldn't play when window was minimized --- img/group_dark.png | Bin 0 -> 503 bytes res.qrc | 14 + ui/chatArea/chatArea.css | 68 +- ui/friendList/friendList.css | 34 + ui/window/applicationIcon.png | Bin 0 -> 1912 bytes ui/window/closeButton.png | Bin 0 -> 385 bytes ui/window/closeButtonHover.png | Bin 0 -> 370 bytes ui/window/closeButtonPressed.png | Bin 0 -> 372 bytes ui/window/maximizeButton.png | Bin 0 -> 401 bytes ui/window/maximizeButtonHover.png | Bin 0 -> 401 bytes ui/window/maximizeButtonPressed.png | Bin 0 -> 402 bytes ui/window/minimizeButton.png | Bin 0 -> 371 bytes ui/window/minimizeButtonHover.png | Bin 0 -> 371 bytes ui/window/minimizeButtonPressed.png | Bin 0 -> 372 bytes ui/window/restoreButton.png | Bin 0 -> 401 bytes ui/window/restoreButtonHover.png | Bin 0 -> 401 bytes ui/window/restoreButtonPressed.png | Bin 0 -> 402 bytes ui/window/window.css | 68 + widget.ui | 5493 ++++++++++++++------------- widget/friendwidget.cpp | 15 +- widget/groupwidget.cpp | 15 +- widget/widget.cpp | 564 ++- widget/widget.h | 32 + 23 files changed, 3620 insertions(+), 2683 deletions(-) create mode 100644 img/group_dark.png create mode 100644 ui/friendList/friendList.css create mode 100644 ui/window/applicationIcon.png create mode 100644 ui/window/closeButton.png create mode 100644 ui/window/closeButtonHover.png create mode 100644 ui/window/closeButtonPressed.png create mode 100644 ui/window/maximizeButton.png create mode 100644 ui/window/maximizeButtonHover.png create mode 100644 ui/window/maximizeButtonPressed.png create mode 100644 ui/window/minimizeButton.png create mode 100644 ui/window/minimizeButtonHover.png create mode 100644 ui/window/minimizeButtonPressed.png create mode 100644 ui/window/restoreButton.png create mode 100644 ui/window/restoreButtonHover.png create mode 100644 ui/window/restoreButtonPressed.png create mode 100644 ui/window/window.css diff --git a/img/group_dark.png b/img/group_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..5978dd47be159738641b9eefb23426d9b72c9629 GIT binary patch literal 503 zcmVP0|S%fo?!E0o{OX02|N^+#l$36w8vqebsyV zLpob`IskYK1E2%ogPZ_3=%QJl-)a{C7foSLK*I)B0qU7dg4c;czfK|*qfl?S!n07g z2*6&*U%E~aep6v^EG!3nOBBrj-h{^Q0KSDDS>x(6ZdGT-F65R|rujr;Pyl res/settings.ini + ui/window/applicationIcon.png + ui/window/closeButton.png + ui/window/closeButtonHover.png + ui/window/closeButtonPressed.png + ui/window/maximizeButton.png + ui/window/maximizeButtonHover.png + ui/window/maximizeButtonPressed.png + ui/window/minimizeButton.png + ui/window/minimizeButtonHover.png + ui/window/minimizeButtonPressed.png + ui/window/restoreButton.png + ui/window/restoreButtonHover.png + ui/window/restoreButtonPressed.png res/DejaVuSans.ttf @@ -81,5 +94,6 @@ ui/videoButton/videoButtonYellow.png ui/videoButton/videoButtonYellowHover.png ui/videoButton/videoButtonYellowPressed.png + img/group_dark.png diff --git a/ui/chatArea/chatArea.css b/ui/chatArea/chatArea.css index 5b621b6b2..9589c06aa 100644 --- a/ui/chatArea/chatArea.css +++ b/ui/chatArea/chatArea.css @@ -1,21 +1,24 @@ QScrollArea { - background: transparent; - border: 0 0 0 0; + background: white; + border: 0 0 0 0 ; } QScrollArea > QWidget > QWidget { - background: transparent; + background: white; } QScrollBar:vertical { - background: white; - width: 10px; - margin: 12px 0 12px 0; + background: transparent; + width: 12px; + margin-top: 2px; + margin-bottom: 2px; } QScrollBar::handle:vertical { background: #d1d1d1; min-height: 20px; + border-radius: 3px; + margin-left: 2px; } QScrollBar::handle:vertical:hover { @@ -27,36 +30,19 @@ QScrollBar::handle:vertical:pressed { } QScrollBar::add-line:vertical { - background: url(":/ui/chatArea/scrollBarDownArrow.png") center; - height: 10px; + background: url(":ui/chatArea/scrollBarDownArrow.png") center; + height: 0px; subcontrol-position: bottom; subcontrol-origin: margin; } -QScrollBar::add-line:vertical:hover { - background: url(":/ui/chatArea/scrollBarDownArrowHover.png") center; -} - -QScrollBar::add-line:vertical:pressed { - background: url(":/ui/chatArea/scrollBarDownArrowPressed.png") center; -} - QScrollBar::sub-line:vertical { - background: url(":/ui/chatArea/scrollBarUpArrow.png") center; - height: 10px; + background: url(":ui/chatArea/scrollBarUpArrow.png") center; + height: 0px; subcontrol-position: top; subcontrol-origin: margin; } -QScrollBar::sub-line:vertical:hover { - background: url(":/ui/chatArea/scrollBarUpArrowHover.png") center; -} - -QScrollBar::sub-line:vertical:pressed { - background: url(":/ui/chatArea/scrollBarUpArrowPressed.png") center; - -} - QScrollBar:QScrollBar::down-arrow:vertical { width: 10; height: 10px; @@ -77,12 +63,13 @@ QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { QScrollBar:horizontal { background: white; height: 10px; - margin: 0 12px 0 12px; + margin: 0 2px 0 2px; } QScrollBar::handle:horizontal { background: #d1d1d1; min-width: 20px; + border-radius: 2px; } QScrollBar::handle:horizontal:hover { @@ -94,36 +81,19 @@ QScrollBar::handle:horizontal:pressed { } QScrollBar::add-line:horizontal { - background: url(":/ui/chatArea/scrollBarRightArrow.png") center; - width: 10px; + background: url(":ui/chatArea/scrollBarRightArrow.png") center; + width: 0px; subcontrol-position: right; subcontrol-origin: margin; } -QScrollBar::add-line:horizontal:hover { - background: url(":/ui/chatArea/scrollBarRightArrowHover.png") center; -} - -QScrollBar::add-line:horizontal:pressed { - background: url(":/ui/chatArea/scrollBarRightArrowPressed.png") center; -} - QScrollBar::sub-line:horizontal { - background: url(":/ui/chatArea/scrollBarLeftArrow.png") center; - width: 10px; + background: url(":ui/chatArea/scrollBarLeftArrow.png") center; + width: 0px; subcontrol-position: left; subcontrol-origin: margin; } -QScrollBar::sub-line:horizontal:hover { - background: url(":/ui/chatArea/scrollBarLeftArrowHover.png") center; -} - -QScrollBar::sub-line:horizontal:pressed { - background: url(":/ui/chatArea/scrollBarLeftArrowPressed.png") center; - -} - QScrollBar:QScrollBar::down-arrow:horizontal { width: 10; height: 10px; diff --git a/ui/friendList/friendList.css b/ui/friendList/friendList.css new file mode 100644 index 000000000..42bf69cc1 --- /dev/null +++ b/ui/friendList/friendList.css @@ -0,0 +1,34 @@ +QScrollArea { + background: #414141!important; +} + +QScrollBar:vertical { + background: #414141!important; + width: 14px!important; + margin-top: 2px!important; + margin-bottom: 2px!important; +} + +QScrollBar:handle:vertical { + background: #1c1c1c!important; + min-height: 20px!important; + border-radius: 3px!important; + margin-left: 3px!important; + margin-right: 1px!important; +} + +QScrollBar:handle:vertical:hover { + background: #2d2d2d!important; +} + +QScrollBar:handle:vertical:pressed { + background: #171717!important; +} + +QScrollBar:add-line:vertical {height: 0px!important;subcontrol-position: bottom!important;subcontrol-origin: margin!important;} + +QScrollBar:sub-line:vertical {height: 0px!important;subcontrol-position: top!important;subcontrol-origin: margin!important;} + +QScrollBar:add-page:vertical, QScrollBar::sub-page:vertical { + background: none!important; +} diff --git a/ui/window/applicationIcon.png b/ui/window/applicationIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..b9cbe71bf9281da551578cc5298fddf1336b6a90 GIT binary patch literal 1912 zcmV-;2Z#8HP)4JQ3Pmll$8$m+MM)tcl4?bDPHm-) zX-|~xA-!mv#g;728d}mA&t>+1PuVTzGq3M6Gfw|={^x(jz4w2=|L@-KzP?M2Gzwxg z%}5T+7oZNH3qU^w)d7`%n`HpB3A76IHfTQR-I`}LT%w;%j^Mx*z_@|>g3b`Kcr|DO zXeNN@lQ{qoyfv6(q&KZCj-Xz#6(HP_82}J`Aed;<|6N>ML9a*%K-ees03i4zFy46k zeJjZTVTaTLfZ%t7i6AKWK?ws0d!!Bk1aAlC8b6;33JM*QCQW)w)uA>jDk}CWDJk`^ z+3ayF7E8aOzF}5hU!OXks?f|}4-g8a1^@)F3Z@d&5G#+Ws%o?2GRM=Q^w4|C%E|-0 z@^p81%SS~<&AW2>%6FZeozxMktOGR$2%XXbAOH;J0QHICCwH??W+&_G>-Pxaud%UF zY2${CUUhYK^GC=Q2moRw4gi8Dlisw5KCg5G1B251U-ILzS{+MJZ*W-R;8$N?KM#u& zs3Ab;moxzM?icV%lb4t8D_|7385$aPiQ>DVp+OlSBy@FkO~lBuSlqDy4*&;AZ&rH4 z#Mag}>uB21tK#_g_3>Sle_FT7s3Nz~RK6x0i7wzT8@ z{rw6&l5YWkuOtnC1%@*8@9@sIl|LGytAkRsc|4a=RpyOeTxHrFB~2w3*3dF5#61 z0K|%cFaWU1>xkPQ7rfMA>0jd3vDj|$&f4d-*1XcB761%_Ts=L#hcFPv!tz(FUSKuf zDx#&O#aN~Q3_@77dR5}yeS1qp^^X=r=4R$6U=~o3IRHptv(uh+BFo=muEi@+{AV1? zm=PBn7mbxJ^#G7)XlVSIlA01_X=&LetpAnESGrYJR@%!n03QI~KSj?&AbZ`^_N{{n8=el?E zIyyLRtFEeEG?G8U0YHFSV9+tta?t6Z{0=Nc5_^05w8Z4Z>w~|8gMzKjpF8g(f-5%Y zAE1{&lK{})A_IWnSAfX|)g&V5{~kh4ZU6?#Z40axw4&ePVd0j!XL9`p1_sDtx^4$` z1qeS24d89?7x+QKL#9lfQc_S@aG1?zlRex$);uVCu$s%|;#DttMV+u9@T>%aNBi$* zpc+I64@>3V_=EBOMMXtMj6%j54u_*lKsB#HrvZeQf&z#HgUd#SpTMs1724|d_4TO{ zTvZeRpbHA19E|B`02oE7001)u1;BHQE91g*>x>0}(66$vIpR<#lq$7xYHjlJ^8Fp` zj`1uO%b4ibfY+K~Q~{vCX*AmD$mqx$>gww6o#vt$fF43$$Y3zOCkli_0jQ{`w85@0 zjNkdd)%>fvL4iRLU0q${#}WW;Kwvsc0semy7;7H05Z`ca6gee27LaNtx zujDZSAm>cZR$)(s%I=qa?DDP4u`vO_|4082cMtb!ValYZrO!C9|3I`bWuz9s>^ZY9 z@sT1ORrJ&NO8UlE0$7LLC4k;k_V|=t4+GN9Xb7{L8WY z&I8-q+do?7uq>ddsc9D8&mi%our@`T850weZ1c6vOJ3>4Ma2_?gM+#(}lpto5pWUi+oY1E5l=PZ_^5B1O3*MYE;R zF)l{P1^_ad+>@G?>Vq}t@e?#CdU|*s8tKcBR0A+JHokW8(#1@1eDM1=DAfRV`R}58 zczXOUj*qm|w9n!X#7D{;0Q9xz(UV6ms;a7DU1aR+>?E6;ndfl1T(Pg-k17Ck1oouj z2`;z9%uLPF@i-zIZ2&C*U^`9#QUHMV2LK-c$PfUu1}MH&yqQ9w^orxBxw%=<#@gmM z9&3S7p9YPLjBaFQXJv>A0R_Lwb<-A%TcU&lK>ygFh)1Q+6S~#Z)SA(>C`>st?Qu99 z3bedfS7G0gUH~wx7hwT-3Wkt9xdep?0EX==umHq>36k^^<1BjtK(L?y&=qua(P*5c zpBg9W0G$p1hJBkD>5kA^FnN-Ga-75&fM$oB};CM!lvI6;>1s;*b z3=G^tAk28_ZrvZCAbW|YuPggqc1ccEv#WRImjZ<(OI#yLobz*YQ}ap~oQqNuOHxx5 z$}>wc6x=<11Hv2m#DR*$K#GF%(@M${i&7a15;OBk^zu?m6ioCCtY3W11gbdc>EamT z;l1_BM&3gXJggU{h)8xA=>~6Laou*xLQ``StH|;HLh48N^-mR8ULo}FhS(E}T|uWb zQ)W1}NrH&0uj^hXws20<-0CkJUboIYrLVIZ-vY7XNtu z!EOI>k(On9?ajZLZNDHQD)l`^pz`;u1&#J%Kd{#ozje$t?s$N0pD9hYhu`ep=m U>^0CV2YQOZ)78&qol`;+05=km-v9sr literal 0 HcmV?d00001 diff --git a/ui/window/closeButtonHover.png b/ui/window/closeButtonHover.png new file mode 100644 index 0000000000000000000000000000000000000000..8b756f08b9e4bdf1418c9083ccfac03062e30a1a GIT binary patch literal 370 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fEa{HEjtmSN`?>!lvI6;>1s;*b z3=G^tAk28_ZrvZCAbW|YuPggqc1ccEv#WRImjZ<(OI#yLobz*YQ}ap~oQqNuOHxx5 z$}>wc6x=<11Hv2m#DR*$K#GF%(@M${i&7a15;OBk^zu?m6ioCCtY3W11ghBO>EamT z;l1_BM&4!z9@clu$R**{ zkjMfeww_UrzIp6hvy8Xdp?SbtDnm{r-UW| D8Xtz3 literal 0 HcmV?d00001 diff --git a/ui/window/closeButtonPressed.png b/ui/window/closeButtonPressed.png new file mode 100644 index 0000000000000000000000000000000000000000..caa1e40744554c16099e678e8898026cb8ea62bf GIT binary patch literal 372 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fEa{HEjtmSN`?>!lvI6;>1s;*b z3=G^tAk28_ZrvZCAbW|YuPggqc1ccEv#WRImjZ<(OI#yLobz*YQ}ap~oQqNuOHxx5 z$}>wc6x=<11Hv2m#DR*$K#GF%(@M${i&7a15;OBk^zu?m6ioCCtY3W11ghBM>EamT z;l1^WAz!lr4{N|NKA9ED(M4p08T9__#p>!r!U zV|(BNGmzLYzl4Ad)cHjQT9foR7o~4ZZo9&)-riC!Zp6I{7 zD>z$~-`ZVNX}`V6f~Tp^S2#U6>UdVSd+uVciQ#gl+jGkLv|JuM*brWr`Y{ct?$Mv; z$F7I%4iG)Mlb5MHUQ|Re`j@~b;a!|!lvI6;>1s;*b z3=G^tAk28_ZrvZCAbW|YuPggqc1ccFxzab2{{n?1OI#yLobz*YQ}ap~oQqNuOHxx5 z$}>wc6x=<11Hv2m#DR*$K#GF%(@M${i&7a15;OBk^zu?m6ioCCtY3W11gf~{>EamT z;l1_BLSCjo0hSBG94t&iT#iB_tO0D3m_B%PIRr4MDqLV`bWjoyX>h4Y6RJC;=lpK+ zZDIXHb!%1 z1#RxLzdCcJcRfS5tVONJ>kps5{FOBpnD$J5X^?jPah{f?z1mZ6{I*V0(3u;%^2p)) zhRlg8w;qlT*DCx_e#RjpYDZA#*8RzBhlJv9+s}W@=M2;%DfU?2qs{5h j+5}T19NW$=eZ^X__v`$H9AEi>o@DTJ^>bP0l+XkK9TJb^ literal 0 HcmV?d00001 diff --git a/ui/window/maximizeButtonHover.png b/ui/window/maximizeButtonHover.png new file mode 100644 index 0000000000000000000000000000000000000000..dae87a3b54d0aed6bf82c99d9dffc0f48ae977c8 GIT binary patch literal 401 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fEa{HEjtmSN`?>!lvI6;>1s;*b z3=G^tAk28_ZrvZCAbW|YuPggqc1ccFxzab2{{n?1OI#yLobz*YQ}ap~oQqNuOHxx5 z$}>wc6x=<11Hv2m#DR*$K#GF%(@M${i&7a15;OBk^zu?m6ioCCtY3W11gf~{>EamT z;l1_BLSCjo0hRz3rbdSc8BCon3YyHGj1?-b3K|VU0wN6#b6gZO7&?EPQTaakb}GmG zJM$_yt#3vao?JdX=v51k@(F_`5HUNXn=$7B$9JiEW9e0XYR*oDY@$o_^9;gcCn<6T zS6pSUi(Dlw&nWi0AXB9N;d9BK)@celYo(S3Mb{taX<52gd#VLkC^mNGk<0fDnG;uT zKFl7jRrsy^j6+1!?x4=O`;*xY3B}*GpZ}OK8K_56?6JH@o711k=K^~E3uk$^38qLm ew!K|?PkN3I=e3&*mg|9@WbkzLb6Mw<&;$UDIf%^w literal 0 HcmV?d00001 diff --git a/ui/window/maximizeButtonPressed.png b/ui/window/maximizeButtonPressed.png new file mode 100644 index 0000000000000000000000000000000000000000..719b3f8bc8cf2195d484e1ac0df1c1d64cb03a92 GIT binary patch literal 402 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fEa{HEjtmSN`?>!lvI6;>1s;*b z3=G^tAk28_ZrvZCAbW|YuPggqc1ccFxzab2{{n?1OI#yLobz*YQ}ap~oQqNuOHxx5 z$}>wc6x=<11Hv2m#DR*$K#GF%(@M${i&7a15;OBk^zu?m6ioCCtY3W11gf~@>EamT z;l1_BLf%6O0;~_XgakNPnnRQ%8w@A#G`JhFG%-prUSt&DP+>aA@Fbk$m)=X&y^kmU zTN3_J_0H+N!oGD~Q!XiFNHn$yf{3h`slqo7amw-j)V(>SRD_qci+jhx=k3-yk>M8v zT7~YNZPe2)d#run5r^K|B=Mg%#`VW}n7m(yX~_>rGrz8=KPg4=Fo|a)jWP0 zER@jRzi!InPvvJ6Hf$+eDpL*C@#)sTpECY4ep{ynMD)}vaJBwWUmMW#U-(rw#2tT^ aE@I1I+Vea~Vu=UPmkge+elF{r5}E+mN|D?E literal 0 HcmV?d00001 diff --git a/ui/window/minimizeButton.png b/ui/window/minimizeButton.png new file mode 100644 index 0000000000000000000000000000000000000000..8773e5359ad2a88b312dd13d86d86e15eab892c0 GIT binary patch literal 371 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fEa{HEjtmSN`?>!lvI6;>1s;*b z3=G^tAk28_ZrvZCAbW|YuPggqc1ccFxzab2{{n?1OI#yLobz*YQ}ap~oQqNuOHxx5 z$}>wc6x=<11Hv2m#DR*$K#GF%(@M${i&7a15;OBk^zu?m6ioCCtY3W11ghBW>EamT z;l1^WAz!lr59@^JRz1H3$d^wl*we zm#6{}Vct?Vj-+kdc)oDXX2x$a2^!N(Hch?A|MLz`m|gkYp>kdeA9B3Kx6aaxTE&n<{+V{a=Id^dFz-L%wS(SG6Vgcpo$atRgkOJ)C^$&!hUW^M<1gTd3)&t;ucLK6Tz Cb%clj literal 0 HcmV?d00001 diff --git a/ui/window/minimizeButtonHover.png b/ui/window/minimizeButtonHover.png new file mode 100644 index 0000000000000000000000000000000000000000..982c032b04daf140c24cd3e933ed9b05c3386df6 GIT binary patch literal 371 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fEa{HEjtmSN`?>!lvI6;>1s;*b z3=G_YAk0{w5<>&kwYU6PYkuJq01zd#|$64!_l=ltB<)VvY~=c3falGGH1 z^30M91$R&1fbd2>aiAhGkfPxHw370~qEv>0#LT=By}Z;C1rt33>la@$fhu-;x;Tb- zcyGO8$k%MZ!y0gmt5Cs>?`mUop{Ut0z8+gA_UnZiD%SfaGE`Rx{Y&8HSg5>6z~Bpm zGe3|xob;C6Y;)_|H?=a$a~f>fCAzlGztMeB{^cE(YDu1@jQpGJa$Jm8HR${F-`^FS zoy>3TE~>QO-ekek%;zhdo*Z>NtJ^(yG1tU!dDHE0%KEfi9z56(UYPnZ4XEzXpXbxo ztu0%q)m1Fb@@}7&hSRn${wMrjs7X{cEM%9s=YCf_RinJ;Y|lplpf?yiUHx3vIVCg! E06^w|-v9sr literal 0 HcmV?d00001 diff --git a/ui/window/minimizeButtonPressed.png b/ui/window/minimizeButtonPressed.png new file mode 100644 index 0000000000000000000000000000000000000000..c72c1a5e9e9f44003305e751c0321ad8140e5139 GIT binary patch literal 372 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fEa{HEjtmSN`?>!lvI6;>1s;*b z3=G_YAk0{w5<>&kwYU6PYkuJq01zd#|$64!_l=ltB<)VvY~=c3falGGH1 z^30M91$R&1fbd2>aiAhGkfPxHw370~qEv>0#LT=By}Z;C1rt33>la@$fhzWRx;Tb- zcyGO8$k%MZ!+N1d)*`^2?`mUoA>+G?8<~@z`^essXIHxUvzNu<@Z=Bd(GDDn$8NCl z+FrQ83?w#09AXeYv*A#+wckyLYBLiNZ;6Mj_w6t3ocN82cWER4X1juP<5dje%Z}&Y zUHP?T_T0r>6YtAQU--14I7IQ&qYcld-8>iAdSdnYS!lvI6;>1s;*b z3=G^tAk28_ZrvZCAbW|YuPggqc1ccFxzab2{{n?1OI#yLobz*YQ}ap~oQqNuOHxx5 z$}>wc6x=<11Hv2m#DR*$K#GF%(@M${i&7a15;OBk^zu?m6ioCCtY3W11gf~{>EamT z;l1_BLSCjo0hSBG94t&iT#iB_tO0D3m_B%PIRr4MDqLV`bWjoyX>h4Y6RJC;=lpK+ zZDIXHb!%1 z1#RxLzdCcJcRfS5tVONJ>kps5{FOBpnD$J5X^?jPah{f?z1mZ6{I*V0(3u;%^2p)) zhRlg8w;qlT*DCx_e#RjpYDZA#*8RzBhlJv9+s}W@=M2;%DfU?2qs{5h j+5}T19NW$=eZ^X__v`$H9AEi>o@DTJ^>bP0l+XkK9TJb^ literal 0 HcmV?d00001 diff --git a/ui/window/restoreButtonHover.png b/ui/window/restoreButtonHover.png new file mode 100644 index 0000000000000000000000000000000000000000..dae87a3b54d0aed6bf82c99d9dffc0f48ae977c8 GIT binary patch literal 401 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fEa{HEjtmSN`?>!lvI6;>1s;*b z3=G^tAk28_ZrvZCAbW|YuPggqc1ccFxzab2{{n?1OI#yLobz*YQ}ap~oQqNuOHxx5 z$}>wc6x=<11Hv2m#DR*$K#GF%(@M${i&7a15;OBk^zu?m6ioCCtY3W11gf~{>EamT z;l1_BLSCjo0hRz3rbdSc8BCon3YyHGj1?-b3K|VU0wN6#b6gZO7&?EPQTaakb}GmG zJM$_yt#3vao?JdX=v51k@(F_`5HUNXn=$7B$9JiEW9e0XYR*oDY@$o_^9;gcCn<6T zS6pSUi(Dlw&nWi0AXB9N;d9BK)@celYo(S3Mb{taX<52gd#VLkC^mNGk<0fDnG;uT zKFl7jRrsy^j6+1!?x4=O`;*xY3B}*GpZ}OK8K_56?6JH@o711k=K^~E3uk$^38qLm ew!K|?PkN3I=e3&*mg|9@WbkzLb6Mw<&;$UDIf%^w literal 0 HcmV?d00001 diff --git a/ui/window/restoreButtonPressed.png b/ui/window/restoreButtonPressed.png new file mode 100644 index 0000000000000000000000000000000000000000..719b3f8bc8cf2195d484e1ac0df1c1d64cb03a92 GIT binary patch literal 402 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fEa{HEjtmSN`?>!lvI6;>1s;*b z3=G^tAk28_ZrvZCAbW|YuPggqc1ccFxzab2{{n?1OI#yLobz*YQ}ap~oQqNuOHxx5 z$}>wc6x=<11Hv2m#DR*$K#GF%(@M${i&7a15;OBk^zu?m6ioCCtY3W11gf~@>EamT z;l1_BLf%6O0;~_XgakNPnnRQ%8w@A#G`JhFG%-prUSt&DP+>aA@Fbk$m)=X&y^kmU zTN3_J_0H+N!oGD~Q!XiFNHn$yf{3h`slqo7amw-j)V(>SRD_qci+jhx=k3-yk>M8v zT7~YNZPe2)d#run5r^K|B=Mg%#`VW}n7m(yX~_>rGrz8=KPg4=Fo|a)jWP0 zER@jRzi!InPvvJ6Hf$+eDpL*C@#)sTpECY4ep{ynMD)}vaJBwWUmMW#U-(rw#2tT^ aE@I1I+Vea~Vu=UPmkge+elF{r5}E+mN|D?E literal 0 HcmV?d00001 diff --git a/ui/window/window.css b/ui/window/window.css new file mode 100644 index 000000000..84c771a95 --- /dev/null +++ b/ui/window/window.css @@ -0,0 +1,68 @@ +Widget#activeWindow +{ + background-color: #DFDFDF; + border: 2px solid #ABABAB; +} + +Widget#inactiveWindow +{ + background-color: #f4f4f4; + border: 2px solid #ABABAB; +} +/* +Widget#titleBar +{ + border: 10px solid #ABABAB; + border-top: 0px solid transparent; + background-color: #DFDFDF; +} + +Widget#titleBarInactive +{ + border: 5px solid #ABABAB; + border-top: 0px solid transparent; + background-color: #F1F1F1; +}*/ + +QToolButton#tbMenu +{ + border: 0px solid transparent; + background-color: transparent; +} + + +QPushButton#minimizeButton +{ + border: 0px solid transparent; + background-color: transparent; + image: url(":ui/window/minimizeButton.png");} +QPushButton#minimizeButton:hover {image: url(":ui/window/minimizeButtonHover.png");} +QPushButton#minimizeButton:pressed {image: url(":ui/window/minimizeButtonPressed.png");} +QPushButton#minimizeButton:focus {outline: none;} + +QPushButton#maximizeButton +{ + border: 0px solid transparent; + background-color: transparent; + image: url(":ui/window/maximizeButton.png");} +QPushButton#maximizeButton:hover {image: url(":ui/window/maximizeButtonHover.png");} +QPushButton#maximizeButton:pressed {image: url(":ui/window/maximizeButtonPressed.png");} +QPushButton#maximizeButton:focus {outline: none;} + +QPushButton#closeButton +{ + border: 0px solid transparent; + background-color: transparent; + image: url(":ui/window/closeButton.png");} +QPushButton#closeButton:hover {image: url(":ui/window/closeButtonHover.png");} +QPushButton#closeButton:pressed {image: url(":ui/window/closeButtonPressed.png");} +QPushButton#closeButton:focus {outline: none;} + +QPushButton#restoreButton +{ + border: 0px solid transparent; + background-color: transparent; + image: url(":ui/window/restoreButton.png");} +QPushButton#restoreButton:hover {image: url(":ui/window/restoreButtonHover.png");} +QPushButton#restoreButton:pressed {image: url(":ui/window/restoreButtonPressed.png");} +QPushButton#restoreButton:focus {outline: none;} diff --git a/widget.ui b/widget.ui index d3000aebf..3ec467ccc 100644 --- a/widget.ui +++ b/widget.ui @@ -1,2610 +1,2883 @@ - - - Widget - - - - 0 - 0 - 600 - 370 - - - - - 600 - 320 - - - - Tox - - - - :/img/icon.png:/img/icon.png - - - - 0 - - - 0 - - - - - - 225 - 0 - - - - - 225 - 16777215 - - - - - - - - - 255 - 255 - 255 - - - - - - - 28 - 28 - 28 - - - - - - - 42 - 42 - 42 - - - - - - - 35 - 35 - 35 - - - - - - - 14 - 14 - 14 - - - - - - - 18 - 18 - 18 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 28 - 28 - 28 - - - - - - - 0 - 0 - 0 - - - - - - - 14 - 14 - 14 - - - - - - - 28 - 28 - 28 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 255 - 255 - 255 - - - - - - - 28 - 28 - 28 - - - - - - - 42 - 42 - 42 - - - - - - - 35 - 35 - 35 - - - - - - - 14 - 14 - 14 - - - - - - - 18 - 18 - 18 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 28 - 28 - 28 - - - - - - - 0 - 0 - 0 - - - - - - - 14 - 14 - 14 - - - - - - - 28 - 28 - 28 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 14 - 14 - 14 - - - - - - - 28 - 28 - 28 - - - - - - - 42 - 42 - 42 - - - - - - - 35 - 35 - 35 - - - - - - - 14 - 14 - 14 - - - - - - - 18 - 18 - 18 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 28 - 28 - 28 - - - - - - - 28 - 28 - 28 - - - - - - - 0 - 0 - 0 - - - - - - - 28 - 28 - 28 - - - - - - - 28 - 28 - 28 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - true - - - - 0 - - - 0 - - - - - - 0 - 60 - - - - - - - - - 255 - 255 - 255 - - - - - - - 28 - 28 - 28 - - - - - - - 42 - 42 - 42 - - - - - - - 35 - 35 - 35 - - - - - - - 14 - 14 - 14 - - - - - - - 18 - 18 - 18 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 28 - 28 - 28 - - - - - - - 0 - 0 - 0 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 255 - 255 - 255 - - - - - - - 28 - 28 - 28 - - - - - - - 42 - 42 - 42 - - - - - - - 35 - 35 - 35 - - - - - - - 14 - 14 - 14 - - - - - - - 18 - 18 - 18 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 28 - 28 - 28 - - - - - - - 0 - 0 - 0 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 14 - 14 - 14 - - - - - - - 28 - 28 - 28 - - - - - - - 42 - 42 - 42 - - - - - - - 35 - 35 - 35 - - - - - - - 14 - 14 - 14 - - - - - - - 18 - 18 - 18 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 28 - 28 - 28 - - - - - - - 28 - 28 - 28 - - - - - - - 0 - 0 - 0 - - - - - - - 28 - 28 - 28 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - true - - - - - 10 - 10 - 40 - 40 - - - - - 40 - 40 - - - - - 40 - 40 - - - - - - - :/img/contact.png - - - true - - - - - true - - - - 70 - 10 - 101 - 20 - - - - - 11 - 75 - true - - - - Your name - - - - - - 70 - 30 - 101 - 16 - - - - - - - - - 193 - 193 - 193 - - - - - - - 193 - 193 - 193 - - - - - - - - - 193 - 193 - 193 - - - - - - - 193 - 193 - 193 - - - - - - - - - 14 - 14 - 14 - - - - - - - 14 - 14 - 14 - - - - - - - - - 8 - - - - Your status - - - - - - 170 - 10 - 40 - 40 - - - - - 40 - 40 - - - - - 40 - 40 - - - - - - - :/img/status/dot_away_2x.png - - - Qt::AlignCenter - - - true - - - - - - - - - - - - - 255 - 255 - 255 - - - - - - - 65 - 65 - 65 - - - - - - - 97 - 97 - 97 - - - - - - - 81 - 81 - 81 - - - - - - - 32 - 32 - 32 - - - - - - - 43 - 43 - 43 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 65 - 65 - 65 - - - - - - - 0 - 0 - 0 - - - - - - - 32 - 32 - 32 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 255 - 255 - 255 - - - - - - - 65 - 65 - 65 - - - - - - - 97 - 97 - 97 - - - - - - - 81 - 81 - 81 - - - - - - - 32 - 32 - 32 - - - - - - - 43 - 43 - 43 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 65 - 65 - 65 - - - - - - - 0 - 0 - 0 - - - - - - - 32 - 32 - 32 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 32 - 32 - 32 - - - - - - - 65 - 65 - 65 - - - - - - - 97 - 97 - 97 - - - - - - - 81 - 81 - 81 - - - - - - - 32 - 32 - 32 - - - - - - - 43 - 43 - 43 - - - - - - - 32 - 32 - 32 - - - - - - - 255 - 255 - 255 - - - - - - - 32 - 32 - 32 - - - - - - - 65 - 65 - 65 - - - - - - - 65 - 65 - 65 - - - - - - - 0 - 0 - 0 - - - - - - - 65 - 65 - 65 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - Qt::RightToLeft - - - QFrame::NoFrame - - - Qt::ScrollBarAlwaysOff - - - true - - - - - 0 - 0 - 225 - 275 - - - - - - - - - - 0 - 35 - - - - - - - - - 255 - 255 - 255 - - - - - - - 28 - 28 - 28 - - - - - - - 42 - 42 - 42 - - - - - - - 35 - 35 - 35 - - - - - - - 14 - 14 - 14 - - - - - - - 18 - 18 - 18 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 28 - 28 - 28 - - - - - - - 0 - 0 - 0 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 255 - 255 - 255 - - - - - - - 28 - 28 - 28 - - - - - - - 42 - 42 - 42 - - - - - - - 35 - 35 - 35 - - - - - - - 14 - 14 - 14 - - - - - - - 18 - 18 - 18 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 28 - 28 - 28 - - - - - - - 0 - 0 - 0 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 14 - 14 - 14 - - - - - - - 28 - 28 - 28 - - - - - - - 42 - 42 - 42 - - - - - - - 35 - 35 - 35 - - - - - - - 14 - 14 - 14 - - - - - - - 18 - 18 - 18 - - - - - - - 14 - 14 - 14 - - - - - - - 255 - 255 - 255 - - - - - - - 14 - 14 - 14 - - - - - - - 28 - 28 - 28 - - - - - - - 28 - 28 - 28 - - - - - - - 0 - 0 - 0 - - - - - - - 28 - 28 - 28 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - true - - - - 0 - - - 0 - - - - - - 55 - 35 - - - - - 55 - 35 - - - - - - - - :/img/add.png:/img/add.png - - - true - - - - - - - - 55 - 35 - - - - - - - - :/img/group.png:/img/group.png - - - true - - - - - - - - 55 - 35 - - - - - 55 - 35 - - - - - - - - :/img/transfer.png:/img/transfer.png - - - true - - - - - - - - 55 - 35 - - - - - 55 - 35 - - - - - - - - :/img/settings.png:/img/settings.png - - - true - - - - - - - - - - - - - - 375 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 127 - 127 - 127 - - - - - - - 170 - 170 - 170 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 127 - 127 - 127 - - - - - - - 170 - 170 - 170 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 127 - 127 - 127 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 127 - 127 - 127 - - - - - - - 170 - 170 - 170 - - - - - - - 127 - 127 - 127 - - - - - - - 255 - 255 - 255 - - - - - - - 127 - 127 - 127 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - true - - - - 0 - - - 0 - - - - - - 0 - 60 - - - - - 16777215 - 60 - - - - - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - - - - - - 193 - 193 - 193 - - - - - - - - - 193 - 193 - 193 - - - - - - - - - 127 - 127 - 127 - - - - - - - - QFrame::HLine - - - QFrame::Plain - - - - - - - - 0 - 0 - - - - - - - - - - - - - EditableLabelWidget - QLabel -
widget/tool/editablelabelwidget.h
-
-
- - - - -
+ + + Widget + + + + 0 + 0 + 640 + 320 + + + + + 1920 + 1080 + + + + Tox + + + + :/img/icon.png:/img/icon.png + + + + 0 + + + 2 + + + 1 + + + 2 + + + 2 + + + + + + 0 + 23 + + + + + 16777215 + 23 + + + + + 4 + + + 5 + + + 0 + + + 1 + + + 0 + + + + + + 16 + 16 + + + + + 16 + 16 + + + + + 16 + 16 + + + + QToolButton::InstantPopup + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 1 + + + + + + + + + 100 + 22 + + + + + 16777215 + 22 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 134 + 20 + + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + + 22 + 22 + + + + true + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + + 22 + 22 + + + + true + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + + 22 + 22 + + + + true + + + + + + + + + + true + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 225 + 0 + + + + + 225 + 16777215 + + + + + + + + + 255 + 255 + 255 + + + + + + + 28 + 28 + 28 + + + + + + + 42 + 42 + 42 + + + + + + + 35 + 35 + 35 + + + + + + + 14 + 14 + 14 + + + + + + + 18 + 18 + 18 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 28 + 28 + 28 + + + + + + + 0 + 0 + 0 + + + + + + + 14 + 14 + 14 + + + + + + + 28 + 28 + 28 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 255 + 255 + 255 + + + + + + + 28 + 28 + 28 + + + + + + + 42 + 42 + 42 + + + + + + + 35 + 35 + 35 + + + + + + + 14 + 14 + 14 + + + + + + + 18 + 18 + 18 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 28 + 28 + 28 + + + + + + + 0 + 0 + 0 + + + + + + + 14 + 14 + 14 + + + + + + + 28 + 28 + 28 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 14 + 14 + 14 + + + + + + + 28 + 28 + 28 + + + + + + + 42 + 42 + 42 + + + + + + + 35 + 35 + 35 + + + + + + + 14 + 14 + 14 + + + + + + + 18 + 18 + 18 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 28 + 28 + 28 + + + + + + + 28 + 28 + 28 + + + + + + + 0 + 0 + 0 + + + + + + + 28 + 28 + 28 + + + + + + + 28 + 28 + 28 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + true + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 60 + + + + + + + + + 255 + 255 + 255 + + + + + + + 28 + 28 + 28 + + + + + + + 42 + 42 + 42 + + + + + + + 35 + 35 + 35 + + + + + + + 14 + 14 + 14 + + + + + + + 18 + 18 + 18 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 28 + 28 + 28 + + + + + + + 0 + 0 + 0 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 255 + 255 + 255 + + + + + + + 28 + 28 + 28 + + + + + + + 42 + 42 + 42 + + + + + + + 35 + 35 + 35 + + + + + + + 14 + 14 + 14 + + + + + + + 18 + 18 + 18 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 28 + 28 + 28 + + + + + + + 0 + 0 + 0 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 14 + 14 + 14 + + + + + + + 28 + 28 + 28 + + + + + + + 42 + 42 + 42 + + + + + + + 35 + 35 + 35 + + + + + + + 14 + 14 + 14 + + + + + + + 18 + 18 + 18 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 28 + 28 + 28 + + + + + + + 28 + 28 + 28 + + + + + + + 0 + 0 + 0 + + + + + + + 28 + 28 + 28 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + true + + + + + 10 + 10 + 40 + 40 + + + + + 40 + 40 + + + + + 40 + 40 + + + + + + + :/img/contact.png + + + true + + + + + true + + + + 70 + 10 + 101 + 20 + + + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 240 + 240 + 240 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 11 + 75 + true + + + + Your name + + + + + + 70 + 30 + 101 + 16 + + + + + + + + + 193 + 193 + 193 + + + + + + + 193 + 193 + 193 + + + + + + + + + 193 + 193 + 193 + + + + + + + 193 + 193 + 193 + + + + + + + + + 14 + 14 + 14 + + + + + + + 14 + 14 + 14 + + + + + + + + + 8 + + + + Your status + + + + + + 170 + 10 + 40 + 40 + + + + + 40 + 40 + + + + + 40 + 40 + + + + + + + img/status/dot_away_2x.png + + + Qt::AlignCenter + + + true + + + profilePicture + statImg + nameLabel + statusLabel + + + + + + Qt::RightToLeft + + + QFrame::NoFrame + + + Qt::ScrollBarAlwaysOff + + + true + + + + + 0 + 0 + 225 + 199 + + + + + + + + + + 0 + 35 + + + + + + + + + 255 + 255 + 255 + + + + + + + 28 + 28 + 28 + + + + + + + 42 + 42 + 42 + + + + + + + 35 + 35 + 35 + + + + + + + 14 + 14 + 14 + + + + + + + 18 + 18 + 18 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 28 + 28 + 28 + + + + + + + 0 + 0 + 0 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 255 + 255 + 255 + + + + + + + 28 + 28 + 28 + + + + + + + 42 + 42 + 42 + + + + + + + 35 + 35 + 35 + + + + + + + 14 + 14 + 14 + + + + + + + 18 + 18 + 18 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 28 + 28 + 28 + + + + + + + 0 + 0 + 0 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 14 + 14 + 14 + + + + + + + 28 + 28 + 28 + + + + + + + 42 + 42 + 42 + + + + + + + 35 + 35 + 35 + + + + + + + 14 + 14 + 14 + + + + + + + 18 + 18 + 18 + + + + + + + 14 + 14 + 14 + + + + + + + 255 + 255 + 255 + + + + + + + 14 + 14 + 14 + + + + + + + 28 + 28 + 28 + + + + + + + 28 + 28 + 28 + + + + + + + 0 + 0 + 0 + + + + + + + 28 + 28 + 28 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + true + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 55 + 35 + + + + + 55 + 35 + + + + + + + + :/img/add.png:/img/add.png + + + true + + + + + + + + 55 + 35 + + + + + + + + :/img/group.png:/img/group.png + + + true + + + + + + + + 55 + 35 + + + + + 55 + 35 + + + + + + + + :/img/transfer.png:/img/transfer.png + + + true + + + + + + + + 55 + 35 + + + + + 55 + 35 + + + + + + + + :/img/settings.png:/img/settings.png + + + true + + + + + + + + + + + + + + 375 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 127 + 127 + 127 + + + + + + + 170 + 170 + 170 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 127 + 127 + 127 + + + + + + + 170 + 170 + 170 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 127 + 127 + 127 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 127 + 127 + 127 + + + + + + + 170 + 170 + 170 + + + + + + + 127 + 127 + 127 + + + + + + + 255 + 255 + 255 + + + + + + + 127 + 127 + 127 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + true + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 60 + + + + + 16777215 + 60 + + + + true + + + + + + + + 0 + 1 + + + + + 16777215 + 1 + + + + + + + + + 193 + 193 + 193 + + + + + + + + + 193 + 193 + 193 + + + + + + + + + 127 + 127 + 127 + + + + + + + + QFrame::HLine + + + QFrame::Plain + + + + + + + + 0 + 0 + + + + + + + + + + + + + + Close + + + Ctrl+Q + + + + + + + EditableLabelWidget + QLabel +
widget/tool/editablelabelwidget.h
+
+
+ + + + + + actionClose + triggered() + Widget + close() + + + -1 + -1 + + + 69 + 61 + + + + +
diff --git a/widget/friendwidget.cpp b/widget/friendwidget.cpp index c01393507..8f66b87fb 100644 --- a/widget/friendwidget.cpp +++ b/widget/friendwidget.cpp @@ -9,6 +9,7 @@ FriendWidget::FriendWidget(int FriendId, QString id) : friendId(FriendId) { + this->setMouseTracking(true); this->setAutoFillBackground(true); this->setLayout(&layout); this->setFixedWidth(225); @@ -18,16 +19,22 @@ FriendWidget::FriendWidget(int FriendId, QString id) textLayout.setSpacing(0); textLayout.setMargin(0); - avatar.setPixmap(QPixmap(":/img/contact.png")); + avatar.setPixmap(QPixmap(":img/contact.png")); name.setText(id); //statusPic.setAlignment(Qt::AlignHCenter); - statusPic.setPixmap(QPixmap(":/img/status/dot_away.png")); + statusPic.setPixmap(QPixmap(":img/status/dot_away.png")); QFont small; small.setPixelSize(10); statusMessage.setFont(small); QPalette pal; pal.setColor(QPalette::WindowText,Qt::gray); statusMessage.setPalette(pal); + QPalette pal2; + pal2.setColor(QPalette::WindowText,Qt::white); + name.setPalette(pal2); + QPalette pal3; + pal3.setColor(QPalette::Background, QColor(65,65,65,255)); + this->setPalette(pal3); textLayout.addStretch(); textLayout.addWidget(&name); @@ -140,7 +147,7 @@ void FriendWidget::setAsActiveChatroom() QPalette pal3; pal3.setColor(QPalette::Background, Qt::white); this->setPalette(pal3); - avatar.setPixmap(QPixmap(":/img/contact_dark.png")); + avatar.setPixmap(QPixmap(":img/contact_dark.png")); } void FriendWidget::setAsInactiveChatroom() @@ -159,5 +166,5 @@ void FriendWidget::setAsInactiveChatroom() QPalette pal3; pal3.setColor(QPalette::Background, QColor(65,65,65,255)); this->setPalette(pal3); - avatar.setPixmap(QPixmap(":/img/contact.png")); + avatar.setPixmap(QPixmap(":img/contact.png")); } diff --git a/widget/groupwidget.cpp b/widget/groupwidget.cpp index 0d44be739..9932f0162 100644 --- a/widget/groupwidget.cpp +++ b/widget/groupwidget.cpp @@ -8,6 +8,7 @@ GroupWidget::GroupWidget(int GroupId, QString Name) : groupId{GroupId} { + this->setMouseTracking(true); this->setAutoFillBackground(true); this->setLayout(&layout); this->setFixedWidth(225); @@ -17,8 +18,8 @@ GroupWidget::GroupWidget(int GroupId, QString Name) textLayout.setSpacing(0); textLayout.setMargin(0); - avatar.setPixmap(QPixmap(":/img/group.png")); - statusPic.setPixmap(QPixmap(":/img/status/dot_groupchat.png")); + avatar.setPixmap(QPixmap(":img/group.png")); + statusPic.setPixmap(QPixmap(":img/status/dot_groupchat.png")); name.setText(Name); QFont small; small.setPixelSize(10); @@ -26,6 +27,12 @@ GroupWidget::GroupWidget(int GroupId, QString Name) QPalette pal; pal.setColor(QPalette::WindowText,Qt::gray); nusers.setPalette(pal); + QPalette pal2; + pal2.setColor(QPalette::WindowText,Qt::white); + name.setPalette(pal2); + QPalette pal3; + pal3.setColor(QPalette::Background, QColor(65,65,65,255)); + this->setPalette(pal3); Group* g = GroupList::findGroup(groupId); if (g) nusers.setText(QString("%1 users in chat").arg(g->peers.size())); @@ -137,7 +144,7 @@ void GroupWidget::setAsActiveChatroom() QPalette pal3; pal3.setColor(QPalette::Background, Qt::white); this->setPalette(pal3); - avatar.setPixmap(QPixmap(":/img/group_dark.png")); + avatar.setPixmap(QPixmap(":img/group_dark.png")); } void GroupWidget::setAsInactiveChatroom() @@ -156,5 +163,5 @@ void GroupWidget::setAsInactiveChatroom() QPalette pal3; pal3.setColor(QPalette::Background, QColor(65,65,65,255)); this->setPalette(pal3); - avatar.setPixmap(QPixmap(":/img/group.png")); + avatar.setPixmap(QPixmap("img/group.png")); } diff --git a/widget/widget.cpp b/widget/widget.cpp index 89019655d..93e7cd283 100644 --- a/widget/widget.cpp +++ b/widget/widget.cpp @@ -12,13 +12,132 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include Widget *Widget::instance{nullptr}; Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget), activeFriendWidget{nullptr}, activeGroupWidget{nullptr} { + //qApp->installEventFilter( this ); ui->setupUi(this); + + QSettings settings("windowSettings.ini", QSettings::IniFormat); + if (!settings.contains("useNativeTheme")) + useNativeTheme = 1; + else + useNativeTheme = settings.value("useNativeTheme").toInt(); + + if (useNativeTheme) + { + ui->titleBar->hide(); + //setWindowFlags(windowFlags() & ~Qt::FramelessWindowHint); + this->layout()->setContentsMargins(0, 0, 0, 0); + + QString friendListStylesheet = ""; + try + { + QFile f("ui/friendList/friendList.css"); + f.open(QFile::ReadOnly | QFile::Text); + QTextStream friendListStylesheetStream(&f); + friendListStylesheet = friendListStylesheetStream.readAll(); + } + catch (int e) {} + ui->friendList->setObjectName("friendList"); + ui->friendList->setStyleSheet(friendListStylesheet); + } + else + { + QString windowStylesheet = ""; + try + { + QFile f("ui/window/window.css"); + f.open(QFile::ReadOnly | QFile::Text); + QTextStream windowStylesheetStream(&f); + windowStylesheet = windowStylesheetStream.readAll(); + } + catch (int e) {} + this->setObjectName("activeWindow"); + this->setStyleSheet(windowStylesheet); + ui->statusPanel->setStyleSheet(QString("")); + ui->friendList->setStyleSheet(QString("")); + + QString friendListStylesheet = ""; + try + { + QFile f("ui/friendList/friendList.css"); + f.open(QFile::ReadOnly | QFile::Text); + QTextStream friendListStylesheetStream(&f); + friendListStylesheet = friendListStylesheetStream.readAll(); + } + catch (int e) {} + ui->friendList->setObjectName("friendList"); + ui->friendList->setStyleSheet(friendListStylesheet); + + ui->tbMenu->setIcon(QIcon(":ui/window/applicationIcon.png")); + ui->pbMin->setObjectName("minimizeButton"); + ui->pbMax->setObjectName("maximizeButton"); + ui->pbClose->setObjectName("closeButton"); + + setWindowFlags(Qt::CustomizeWindowHint); + setWindowFlags(Qt::FramelessWindowHint); + setAttribute(Qt::WA_DeleteOnClose); + setMouseTracking(true); + ui->titleBar->setMouseTracking(true); + ui->LTitle->setMouseTracking(true); + ui->tbMenu->setMouseTracking(true); + ui->pbMin->setMouseTracking(true); + ui->pbMax->setMouseTracking(true); + ui->pbClose->setMouseTracking(true); + + addAction(ui->actionClose); + + connect(ui->pbMin, SIGNAL(clicked()), this, SLOT(minimizeBtnClicked())); + connect(ui->pbMax, SIGNAL(clicked()), this, SLOT(maximizeBtnClicked())); + connect(ui->pbClose, SIGNAL(clicked()), this, SLOT(close())); + + m_titleMode = FullTitle; + moveWidget = false; + inResizeZone = false; + allowToResize = false; + resizeVerSup = false; + resizeHorEsq = false; + resizeDiagSupEsq = false; + resizeDiagSupDer = false; + + QSettings settings("windowSettings.ini", QSettings::IniFormat); + QRect geo = settings.value("geometry").toRect(); + + if (geo.height() > 0 and geo.x() < QApplication::desktop()->width() and geo.width() > 0 and geo.y() < QApplication::desktop()->height()) + setGeometry(geo); + + if (settings.value("maximized").toBool()) + { + showMaximized(); + ui->pbMax->setObjectName("restoreButton"); + } + + QList widgets = this->findChildren(); + + foreach (QWidget *widget, widgets) + { + widget->setMouseTracking(true); + } + } + + isWindowMinimized = 0; + + centralLayout = new QHBoxLayout(ui->centralWidget); + centralLayout->setContentsMargins(9,9,9,9); + + ui->mainContent->setLayout(new QVBoxLayout()); ui->mainHead->setLayout(new QVBoxLayout()); ui->mainHead->layout()->setMargin(0); @@ -31,7 +150,9 @@ Widget::Widget(QWidget *parent) : ui->friendList->setWidget(friendListWidget); ui->nameLabel->setText(Settings::getInstance().getUsername()); + ui->nameLabel->label->setStyleSheet("QLabel { color : white; font-size: 11pt; font-weight:bold;}"); ui->statusLabel->setText(Settings::getInstance().getStatusMessage()); + ui->statusLabel->label->setStyleSheet("QLabel { color : white; font-size: 8pt;}"); ui->friendList->widget()->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); camera = new Camera; @@ -107,8 +228,12 @@ Widget::~Widget() for (Group* g : GroupList::groupList) delete g; GroupList::groupList.clear(); - + QSettings settings("windowSettings.ini", QSettings::IniFormat); + settings.setValue("geometry", geometry()); + settings.setValue("maximized", isMaximized()); + settings.setValue("useNativeTheme", useNativeTheme); delete ui; + delete centralLayout; } Widget* Widget::getInstance() @@ -118,6 +243,7 @@ Widget* Widget::getInstance() return instance; } + QString Widget::getUsername() { return ui->nameLabel->text(); @@ -150,11 +276,11 @@ void Widget::onFailedToStartCore() void Widget::onStatusSet(Status status) { if (status == Status::Online) - ui->statImg->setPixmap(QPixmap(":/img/status/dot_online_2x.png")); + ui->statImg->setPixmap(QPixmap(":img/status/dot_online_2x.png")); else if (status == Status::Busy || status == Status::Away) - ui->statImg->setPixmap(QPixmap(":/img/status/dot_idle_2x.png")); + ui->statImg->setPixmap(QPixmap(":img/status/dot_idle_2x.png")); else if (status == Status::Offline) - ui->statImg->setPixmap(QPixmap(":/img/status/dot_away_2x.png")); + ui->statImg->setPixmap(QPixmap(":img/status/dot_away_2x.png")); } void Widget::onAddClicked() @@ -358,7 +484,7 @@ void Widget::onFriendMessageReceived(int friendId, const QString& message) if (activeFriendWidget != nullptr) { Friend* f2 = FriendList::findFriend(activeFriendWidget->friendId); - if ((f->friendId != f2->friendId) || isFriendWidgetActive == 0) + if (((f->friendId != f2->friendId) || isFriendWidgetActive == 0) || isWindowMinimized) { f->hasNewMessages = 1; newMessageAlert(); @@ -378,23 +504,23 @@ void Widget::updateFriendStatusLights(int friendId) Friend* f = FriendList::findFriend(friendId); Status status = f->friendStatus; if (status == Status::Online && f->hasNewMessages == 0) - f->widget->statusPic.setPixmap(QPixmap(":/img/status/dot_online.png")); + f->widget->statusPic.setPixmap(QPixmap(":img/status/dot_online.png")); else if (status == Status::Online && f->hasNewMessages == 1) - f->widget->statusPic.setPixmap(QPixmap(":/img/status/dot_online_notification.png")); + f->widget->statusPic.setPixmap(QPixmap(":img/status/dot_online_notification.png")); else if ((status == Status::Busy || status == Status::Away) && f->hasNewMessages == 0) - f->widget->statusPic.setPixmap(QPixmap(":/img/status/dot_idle.png")); + f->widget->statusPic.setPixmap(QPixmap(":img/status/dot_idle.png")); else if ((status == Status::Busy || status == Status::Away) && f->hasNewMessages == 1) - f->widget->statusPic.setPixmap(QPixmap(":/img/status/dot_idle_notification.png")); + f->widget->statusPic.setPixmap(QPixmap(":img/status/dot_idle_notification.png")); else if (status == Status::Offline && f->hasNewMessages == 0) - f->widget->statusPic.setPixmap(QPixmap(":/img/status/dot_away.png")); + f->widget->statusPic.setPixmap(QPixmap(":img/status/dot_away.png")); else if (status == Status::Offline && f->hasNewMessages == 1) - f->widget->statusPic.setPixmap(QPixmap(":/img/status/dot_away_notification.png")); + f->widget->statusPic.setPixmap(QPixmap(":img/status/dot_away_notification.png")); } void Widget::newMessageAlert() { QApplication::alert(this, 1000); - QSound::play(":/audio/notification.wav"); + QSound::play(":audio/notification.wav"); } void Widget::onFriendRequestReceived(const QString& userId, const QString& message) @@ -435,20 +561,20 @@ void Widget::onGroupMessageReceived(int groupnumber, int friendgroupnumber, cons g->chatForm->addGroupMessage(message, friendgroupnumber); - if (isGroupWidgetActive != 1 || (g->groupId != activeGroupWidget->groupId)) + if ((isGroupWidgetActive != 1 || (g->groupId != activeGroupWidget->groupId)) || isWindowMinimized) { if (message.contains(Settings::getInstance().getUsername(), Qt::CaseInsensitive)) { newMessageAlert(); g->hasNewMessages = 1; g->userWasMentioned = 1; - g->widget->statusPic.setPixmap(QPixmap(":/img/status/dot_groupchat_notification.png")); + g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat_notification.png")); } else if (g->hasNewMessages == 0) { g->hasNewMessages = 1; - g->widget->statusPic.setPixmap(QPixmap(":/img/status/dot_groupchat_newmessages.png")); + g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat_newmessages.png")); } } } @@ -492,7 +618,7 @@ void Widget::onGroupWidgetClicked(GroupWidget* widget) { g->hasNewMessages = 0; g->userWasMentioned = 0; - g->widget->statusPic.setPixmap(QPixmap(":/img/status/dot_groupchat.png")); + g->widget->statusPic.setPixmap(QPixmap("img/status/dot_groupchat.png")); } } @@ -557,3 +683,409 @@ bool Widget::isFriendWidgetCurActiveWidget(Friend* f) return false; return true; } + + + +void Widget::mouseMoveEvent(QMouseEvent *e) +{ + if (!useNativeTheme) + { + int xMouse = e->pos().x(); + int yMouse = e->pos().y(); + int wWidth = this->geometry().width(); + int wHeight = this->geometry().height(); + + if (moveWidget) + { + inResizeZone = false; + moveWindow(e); + } + else if (allowToResize) + resizeWindow(e); + //right + else if (xMouse >= wWidth - PIXELS_TO_ACT or allowToResize) + { + inResizeZone = true; + + if (yMouse >= wHeight - PIXELS_TO_ACT) + setCursor(Qt::SizeFDiagCursor); + else if (yMouse <= PIXELS_TO_ACT) + setCursor(Qt::SizeBDiagCursor); + else + setCursor(Qt::SizeHorCursor); + + resizeWindow(e); + } + //left + else if (xMouse <= PIXELS_TO_ACT or allowToResize) + { + inResizeZone = true; + + if (yMouse >= wHeight - PIXELS_TO_ACT) + setCursor(Qt::SizeBDiagCursor); + else if (yMouse <= PIXELS_TO_ACT) + setCursor(Qt::SizeFDiagCursor); + else + setCursor(Qt::SizeHorCursor); + + resizeWindow(e); + } + //bottom edge + else if ((yMouse >= wHeight - PIXELS_TO_ACT) or allowToResize) + { + inResizeZone = true; + setCursor(Qt::SizeVerCursor); + + resizeWindow(e); + } + //Cursor part top + else if (yMouse <= PIXELS_TO_ACT or allowToResize) + { + inResizeZone = true; + setCursor(Qt::SizeVerCursor); + + resizeWindow(e); + } + else + { + inResizeZone = false; + setCursor(Qt::ArrowCursor); + } + + e->accept(); + } +} + +bool Widget::event(QEvent * e) +{ + if (e->type() == QEvent::WindowStateChange) + { + if(windowState().testFlag(Qt::WindowMinimized) == true) + { + isWindowMinimized = 1; + } + } + else if (e->type() == QEvent::WindowActivate) + { + if (!useNativeTheme) + { + this->setObjectName("activeWindow"); + this->style()->polish(this); + } + qDebug() << "test"; + isWindowMinimized = 0; + if (isFriendWidgetActive && activeFriendWidget != nullptr) + { + Friend* f = FriendList::findFriend(activeFriendWidget->friendId); + f->hasNewMessages = 0; + updateFriendStatusLights(f->friendId); + } + else if (isGroupWidgetActive && activeGroupWidget != nullptr) + { + Group* g = GroupList::findGroup(activeGroupWidget->groupId); + g->hasNewMessages = 0; + g->userWasMentioned = 0; + g->widget->statusPic.setPixmap(QPixmap("img/status/dot_groupchat.png")); + } + } + else if (e->type() == QEvent::WindowDeactivate && !useNativeTheme) + { + this->setObjectName("inactiveWindow"); + this->style()->polish(this); + } + + return QWidget::event(e); +} + +void Widget::mousePressEvent(QMouseEvent *e) +{ + if (!useNativeTheme) + { + if (e->button() == Qt::LeftButton) + { + if (inResizeZone) + { + allowToResize = true; + + if (e->pos().y() <= PIXELS_TO_ACT) + { + if (e->pos().x() <= PIXELS_TO_ACT) + resizeDiagSupEsq = true; + else if (e->pos().x() >= geometry().width() - PIXELS_TO_ACT) + resizeDiagSupDer = true; + else + resizeVerSup = true; + } + else if (e->pos().x() <= PIXELS_TO_ACT) + resizeHorEsq = true; + } + else if (e->pos().x() >= PIXELS_TO_ACT and e->pos().x() < ui->titleBar->geometry().width() + and e->pos().y() >= PIXELS_TO_ACT and e->pos().y() < ui->titleBar->geometry().height()) + { + moveWidget = true; + dragPosition = e->globalPos() - frameGeometry().topLeft(); + } + } + + e->accept(); + } +} + +void Widget::mouseReleaseEvent(QMouseEvent *e) +{ + if (!useNativeTheme) + { + moveWidget = false; + allowToResize = false; + resizeVerSup = false; + resizeHorEsq = false; + resizeDiagSupEsq = false; + resizeDiagSupDer = false; + + e->accept(); + } +} + +void Widget::mouseDoubleClickEvent(QMouseEvent *e) +{ + if (!useNativeTheme) + { + if (e->pos().x() < ui->tbMenu->geometry().right() and e->pos().y() < ui->tbMenu->geometry().bottom() + and e->pos().x() >= ui->tbMenu->geometry().x() and e->pos().y() >= ui->tbMenu->geometry().y() + and ui->tbMenu->isVisible()) + close(); + else if (e->pos().x() < ui->titleBar->geometry().width() + and e->pos().y() < ui->titleBar->geometry().height() + and m_titleMode != FullScreenMode) + maximizeBtnClicked(); + e->accept(); + } +} + +void Widget::paintEvent (QPaintEvent *) +{ + QStyleOption opt; + opt.init (this); + QPainter p(this); + style()->drawPrimitive (QStyle::PE_Widget, &opt, &p, this); +} + +void Widget::moveWindow(QMouseEvent *e) +{ + if (!useNativeTheme) + { + if (e->buttons() & Qt::LeftButton) + { + move(e->globalPos() - dragPosition); + e->accept(); + } + } +} + +void Widget::resizeWindow(QMouseEvent *e) +{ + if (!useNativeTheme) + { + if (allowToResize) + { + int xMouse = e->pos().x(); + int yMouse = e->pos().y(); + int wWidth = geometry().width(); + int wHeight = geometry().height(); + + if (cursor().shape() == Qt::SizeVerCursor) + { + if (resizeVerSup) + { + int newY = geometry().y() + yMouse; + int newHeight = wHeight - yMouse; + + if (newHeight > minimumSizeHint().height()) + { + resize(wWidth, newHeight); + move(geometry().x(), newY); + } + } + else + resize(wWidth, yMouse+1); + } + else if (cursor().shape() == Qt::SizeHorCursor) + { + if (resizeHorEsq) + { + int newX = geometry().x() + xMouse; + int newWidth = wWidth - xMouse; + + if (newWidth > minimumSizeHint().width()) + { + resize(newWidth, wHeight); + move(newX, geometry().y()); + } + } + else + resize(xMouse, wHeight); + } + else if (cursor().shape() == Qt::SizeBDiagCursor) + { + int newX = 0; + int newWidth = 0; + int newY = 0; + int newHeight = 0; + + if (resizeDiagSupDer) + { + newX = geometry().x(); + newWidth = xMouse; + newY = geometry().y() + yMouse; + newHeight = wHeight - yMouse; + } + else + { + newX = geometry().x() + xMouse; + newWidth = wWidth - xMouse; + newY = geometry().y(); + newHeight = yMouse; + } + + if (newWidth >= minimumSizeHint().width() and newHeight >= minimumSizeHint().height()) + { + resize(newWidth, newHeight); + move(newX, newY); + } + else if (newWidth >= minimumSizeHint().width()) + { + resize(newWidth, wHeight); + move(newX, geometry().y()); + } + else if (newHeight >= minimumSizeHint().height()) + { + resize(wWidth, newHeight); + move(geometry().x(), newY); + } + } + else if (cursor().shape() == Qt::SizeFDiagCursor) + { + if (resizeDiagSupEsq) + { + int newX = geometry().x() + xMouse; + int newWidth = wWidth - xMouse; + int newY = geometry().y() + yMouse; + int newHeight = wHeight - yMouse; + + if (newWidth >= minimumSizeHint().width() and newHeight >= minimumSizeHint().height()) + { + resize(newWidth, newHeight); + move(newX, newY); + } + else if (newWidth >= minimumSizeHint().width()) + { + resize(newWidth, wHeight); + move(newX, geometry().y()); + } + else if (newHeight >= minimumSizeHint().height()) + { + resize(wWidth, newHeight); + move(geometry().x(), newY); + } + } + else + resize(xMouse+1, yMouse+1); + } + + e->accept(); + } + } +} + +void Widget::setCentralWidget(QWidget *widget, const QString &widgetName) +{ + connect(widget, SIGNAL(cancelled()), this, SLOT(close())); + + centralLayout->addWidget(widget); + ui->centralWidget->setLayout(centralLayout); + ui->LTitle->setText(widgetName); +} + +void Widget::setTitlebarMode(const TitleMode &flag) +{ + m_titleMode = flag; + + switch (m_titleMode) + { + case CleanTitle: + ui->tbMenu->setHidden(true); + ui->pbMin->setHidden(true); + ui->pbMax->setHidden(true); + ui->pbClose->setHidden(true); + break; + case OnlyCloseButton: + ui->tbMenu->setHidden(true); + ui->pbMin->setHidden(true); + ui->pbMax->setHidden(true); + break; + case MenuOff: + ui->tbMenu->setHidden(true); + break; + case MaxMinOff: + ui->pbMin->setHidden(true); + ui->pbMax->setHidden(true); + break; + case FullScreenMode: + ui->pbMax->setHidden(true); + showMaximized(); + break; + case MaximizeModeOff: + ui->pbMax->setHidden(true); + break; + case MinimizeModeOff: + ui->pbMin->setHidden(true); + break; + case FullTitle: + ui->tbMenu->setVisible(true); + ui->pbMin->setVisible(true); + ui->pbMax->setVisible(true); + ui->pbClose->setVisible(true); + break; + break; + default: + ui->tbMenu->setVisible(true); + ui->pbMin->setVisible(true); + ui->pbMax->setVisible(true); + ui->pbClose->setVisible(true); + break; + } + ui->LTitle->setVisible(true); +} + +void Widget::setTitlebarMenu(QMenu *menu, const QString &icon) +{ + ui->tbMenu->setMenu(menu); + ui->tbMenu->setIcon(QIcon(icon)); +} + +void Widget::maximizeBtnClicked() +{ + if (isFullScreen() or isMaximized()) + { + ui->pbMax->setIcon(QIcon(":/ui/images/app_max.png")); + setWindowState(windowState() & ~Qt::WindowFullScreen & ~Qt::WindowMaximized); + } + else + { + ui->pbMax->setIcon(QIcon(":/ui/images/app_rest.png")); + setWindowState(windowState() | Qt::WindowFullScreen | Qt::WindowMaximized); + } +} + +void Widget::minimizeBtnClicked() +{ + if (isMinimized()) + { + setWindowState(windowState() & ~Qt::WindowMinimized); + } + else + { + setWindowState(windowState() | Qt::WindowMinimized); + } +} + diff --git a/widget/widget.h b/widget/widget.h index 6abdec89a..0d6d03d5d 100644 --- a/widget/widget.h +++ b/widget/widget.h @@ -4,11 +4,15 @@ #include #include #include +#include +#include #include "core.h" #include "widget/form/addfriendform.h" #include "widget/form/settingsform.h" #include "camera.h" +#define PIXELS_TO_ACT 5 + namespace Ui { class Widget; } @@ -26,6 +30,10 @@ class Widget : public QWidget public: explicit Widget(QWidget *parent = 0); + enum TitleMode { CleanTitle = 0, OnlyCloseButton, MenuOff, MaxMinOff, FullScreenMode, MaximizeModeOff, MinimizeModeOff, FullTitle }; + void setTitlebarMode(const TitleMode &flag); + void setTitlebarMenu(QMenu *menu, const QString &icon = ""); + void setCentralWidget(QWidget *widget, const QString &widgetName); QString getUsername(); Core* getCore(); Camera* getCamera(); @@ -34,6 +42,7 @@ public: void newMessageAlert(); bool isFriendWidgetCurActiveWidget(Friend* f); void updateFriendStatusLights(int friendId); + int useNativeTheme; ~Widget(); signals: @@ -45,6 +54,8 @@ signals: void statusMessageChanged(const QString& statusMessage); private slots: + void maximizeBtnClicked(); + void minimizeBtnClicked(); void onConnected(); void onDisconnected(); void onStatusSet(Status status); @@ -77,12 +88,33 @@ private slots: void removeFriend(int friendId); void removeGroup(int groupId); +protected slots: + void moveWindow(QMouseEvent *e); + private: void hideMainForms(); Group* createGroup(int groupId); private: Ui::Widget *ui; + QHBoxLayout *centralLayout; + QPoint dragPosition; + TitleMode m_titleMode; + bool moveWidget; + bool inResizeZone; + bool allowToResize; + bool resizeVerSup; + bool resizeHorEsq; + bool resizeDiagSupEsq; + bool resizeDiagSupDer; + void mouseMoveEvent(QMouseEvent *e); + void mousePressEvent(QMouseEvent *e); + void mouseReleaseEvent(QMouseEvent *e); + void mouseDoubleClickEvent(QMouseEvent *e); + void paintEvent (QPaintEvent *); + void resizeWindow(QMouseEvent *e); + bool event(QEvent *event); + int isWindowMinimized; Core* core; QThread* coreThread; AddFriendForm friendForm;