From 33e487d0dd24bb57983ad03d1da924522bf789f9 Mon Sep 17 00:00:00 2001 From: Kevin Flynn Date: Sat, 28 Jun 2014 13:02:19 -0700 Subject: [PATCH 1/2] Added skinned scrollbar in chat --- img/contact list icons/contact_dark.png | Bin 549 -> 744 bytes ui/chatArea/chatArea.css | 65 ++++++++++++++++++++++ ui/chatArea/scrollBarArrows.xcf | Bin 0 -> 3062 bytes ui/chatArea/scrollBarDownArrow.png | Bin 0 -> 233 bytes ui/chatArea/scrollBarDownArrowHover.png | Bin 0 -> 228 bytes ui/chatArea/scrollBarDownArrowPressed.png | Bin 0 -> 228 bytes ui/chatArea/scrollBarHandle.png | Bin 0 -> 327 bytes ui/chatArea/scrollBarUpArrow.png | Bin 0 -> 236 bytes ui/chatArea/scrollBarUpArrowHover.png | Bin 0 -> 217 bytes ui/chatArea/scrollBarUpArrowPressed.png | Bin 0 -> 217 bytes widget/form/chatform.cpp | 11 ++++ 11 files changed, 76 insertions(+) create mode 100644 ui/chatArea/chatArea.css create mode 100644 ui/chatArea/scrollBarArrows.xcf create mode 100644 ui/chatArea/scrollBarDownArrow.png create mode 100644 ui/chatArea/scrollBarDownArrowHover.png create mode 100644 ui/chatArea/scrollBarDownArrowPressed.png create mode 100644 ui/chatArea/scrollBarHandle.png create mode 100644 ui/chatArea/scrollBarUpArrow.png create mode 100644 ui/chatArea/scrollBarUpArrowHover.png create mode 100644 ui/chatArea/scrollBarUpArrowPressed.png diff --git a/img/contact list icons/contact_dark.png b/img/contact list icons/contact_dark.png index be08811bce0b5b8fe650c629ad0ad21d9bf54a63..584a4669e5fc03f8021187a32de68d72dceeb8ca 100644 GIT binary patch delta 673 zcmV;S0$%;41n32jQ-2&300kN;$RfV|H++8mk!#{!O1HD z!6jfvU8Kd97BZDWD0C2yPR@=uWiAB7!=aF+Wa>~_Xe~(6%^OOWfT%b)MH~X5K{9+d zDLJb760P3blJC9u%l~`d`|=n>G+o!r-EOx&9*+S4@pv42dw+XB^ZESmD0!GDz{khO z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Z4 z64IBj@8Ce|_qDgAjTkq;aFToPch0@1z4v_W*ZRT!#621e-C;2D1h%Le@k2CCL)SrD z*!n8M2782NqV>?8D9m+_vHmH>2R<&_4feNvuj@~PU4#Vlnyf?z$0N^;!cnlhy0|j* z2jM83x+}%do%%c5ZtrEUuq(itnp#Eb&K0TEy!&s!)T3y!JqX6WyH?!`!Q-ofD%L$5 z2M2C29_)D$^TXjV@(wOH$n3vEWu%$PIw;e=i5No>t1n{zM0vlX_IuSV#)=5mwS72o zCsQwqyrPsgLM(rdwxBSVwG_r6q=9Q_yi|qTHGHpzmumPvFt1yg15o8x)bl#Z^tTFB zTgF=beKV$y>FY8};y4jYwAhj?iS;;3#1JDk=$Z61v0{y$9bY7ZK9hJko=2u3+Lj|) zV#{nZ&o@zmS(4}6Z?>N6dA5%8WT!-@*mbs%oB3=*ocHjcfSubMIQ4SiCRrUj`fNlo>%BsC?e zsYwr{rX)4BQ;>>2lXN+qN9K)@Y8*~jjk`dj&W)62{ZgPtqxHKPvpEME4Ls>uVu_WQ zz=k-94y;Kl$t1DaEhBP$t8R>nrQPt;_Pj*?1{5u5Z188soQkg7spwYg+wRJ)54D&Kj((81Z62z4>rph7CG!~v9k z8cI>2tcAkjyO2O}w+x=WDo*hMEEv7i%)9WCJ?9=vYrRvT+A_4V^`RMSh4ecVK4_p& z3CSnqk$jda2|iQuSt=;_Ovxv;6@1Pi^XB-p$R`VO7ntPljj}fWU<<1;*9ioB{An-{yUtbD$i^Rl3f6)E literal 0 HcmV?d00001 diff --git a/ui/chatArea/scrollBarDownArrow.png b/ui/chatArea/scrollBarDownArrow.png new file mode 100644 index 0000000000000000000000000000000000000000..0650e79441c562eb5e6aa406194ce542042b1c5f GIT binary patch literal 233 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4u_bxCyDx`7I;J! zGca%qgD@k*tT_@uLG}_)Usv{fY%;=HdUrO7Z37CGdAc};NL+61HRL)Jr!-jKR<_RRKhSr7msrAs{cQ{z{xV$Sz7Tv#ErtDnm{r-UW|X?;&s literal 0 HcmV?d00001 diff --git a/ui/chatArea/scrollBarDownArrowHover.png b/ui/chatArea/scrollBarDownArrowHover.png new file mode 100644 index 0000000000000000000000000000000000000000..b644bbf163aaff6611e1f8e3ad7a7a1870cb082c GIT binary patch literal 228 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4u_bxCyDx`7I;J! zGca%qgD@k*tT_@uLG}_)Usv{fY%;=@g51_sl0czCPZ!4!iOa418+n@@1X!NOn{4#G zp&%SAyrhKPki$p#cH89ROizwaetR#|Pdta;;jnEoOVz*2>f4u_bxCyDx`7I;J! zGca%qgD@k*tT_@uLG}_)Usv{fY%;<|vJWfY{{#vZdb&7lYjWQfx`y?k)`fL2$v|<&%LToCO|{ z#S9GG!XV7ZFl&wkP>{XE)7O>#9-EAi3FjK?Z>B&Y$r9Iy66gHf+|;}h2Ir#G#FEq$ zh4Rdj3J z5S4KDeN}?;%S5{iOxnw~e)`IC|JB5wvS-dq1Si&68b1A2xVrdMkG+@0!xmvbi-#{O zI<_?b^p+3KcaZJOW?tnHGjj=_M*5+kAaS?*D|8Fkro~^7z2UiwX%7RliHfm!zxpen P(-}Nn{an^LB{Ts58mx2D literal 0 HcmV?d00001 diff --git a/ui/chatArea/scrollBarUpArrow.png b/ui/chatArea/scrollBarUpArrow.png new file mode 100644 index 0000000000000000000000000000000000000000..fcf1b9fad5cafe881f601f9ebc38533774020bd6 GIT binary patch literal 236 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4u_bxCyDx`7I;J! zGca%qgD@k*tT_@uLG}_)Usv{fY%;={=99m?-3k<{^mK6yk+|I2@5ps1fX5}iO5yk- zYwazzG5uG$%2sAnDVb~5Fvs7|JM^JVg7qDrf!iF_z@yDI+f$?)Ed7)>ya_vP_CTO8 zcw=tsTIP3|AGy{{+P6&pfTrmDN#_{Ew#h|k{pUT9JHL+cxYtMBm8RwU8MODmluCGH bf0;crQs+Q)-SQtmM=*H0`njxgN@xNAf4u_bxCyDx`7I;J! zGca%qgD@k*tT_@uLG}_)Usv{fY%;=@x+)=T^MFEWo-U3d5|>;1b_zBa@UV#Uf1S}F zz_h?(d0F6>qTC4`=lOG#&SpM$o1mCEdCSvEf6pzJHqO(xu5Do7^R`sbqxY|v>e*{$ zk94)Af}h_1BBZK&AVSc6cWm!OGrf4u_bxCyDx`7I;J! zGca%qgD@k*tT_@uLG}_)Usv{fY%;=z3X^O;Xaj}PJY5_^Brdo1?G$V<;9(Kx|2m^V zfN6on@-pq~%&ikU&hzIeoy~miHbF6S@|LHS{+?SbZJeiXUE9FE=WVH=NAF)T)w9>i z9_eaJ1wXz2MMzcmK!l+C?%3XmW`YYQn=o46Kf}lIN0{&FHW|A#j~Zj3jSQZyelF{r G5}E*N97U)A literal 0 HcmV?d00001 diff --git a/widget/form/chatform.cpp b/widget/form/chatform.cpp index fe9b904ec..f3b698bef 100644 --- a/widget/form/chatform.cpp +++ b/widget/form/chatform.cpp @@ -29,9 +29,20 @@ ChatForm::ChatForm(Friend* chatFriend) avatar->setPixmap(*chatFriend->widget->avatar.pixmap()); chatAreaWidget->setLayout(mainChatLayout); + QString chatAreaStylesheet = ""; + try + { + QFile f("ui/chatArea/chatArea.css"); + f.open(QFile::ReadOnly | QFile::Text); + QTextStream chatAreaStylesheetStream(&f); + chatAreaStylesheet = chatAreaStylesheetStream.readAll(); + } + catch (int e) {} + chatArea->setStyleSheet(chatAreaStylesheet); chatArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); chatArea->setWidgetResizable(true); chatArea->setContextMenuPolicy(Qt::CustomContextMenu); + mainChatLayout->setColumnStretch(1,1); mainChatLayout->setSpacing(10); From 36b2c496cb51c0ba5922d08918b119d965882204 Mon Sep 17 00:00:00 2001 From: Kevin Flynn Date: Sat, 28 Jun 2014 13:56:47 -0700 Subject: [PATCH 2/2] Make chatArea and msgEdit more like the mockup --- ui/chatArea/chatArea.css | 11 ++++++++- ui/chatArea/scrollBarDownArrowHover.png | Bin 228 -> 228 bytes ui/chatArea/scrollBarUpArrowHover.png | Bin 217 -> 217 bytes widget/form/chatform.cpp | 16 +++++++++--- widget/form/groupchatform.cpp | 31 +++++++++++++++++++++++- 5 files changed, 52 insertions(+), 6 deletions(-) diff --git a/ui/chatArea/chatArea.css b/ui/chatArea/chatArea.css index aea8478dd..8725f4868 100644 --- a/ui/chatArea/chatArea.css +++ b/ui/chatArea/chatArea.css @@ -1,3 +1,12 @@ +QScrollArea { + background: transparent; + border: 0 0 0 0; +} + +QScrollArea > QWidget > QWidget { + background: transparent; +} + QScrollBar:vertical { background: white; width: 10px; @@ -10,7 +19,7 @@ QScrollBar::handle:vertical { } QScrollBar::handle:vertical:hover { - background: #e7e7e7; + background: #e3e3e3; } QScrollBar::handle:vertical:pressed { diff --git a/ui/chatArea/scrollBarDownArrowHover.png b/ui/chatArea/scrollBarDownArrowHover.png index b644bbf163aaff6611e1f8e3ad7a7a1870cb082c..54ae2cf6a77adb083ee4da15fc8ae72f78ed103d 100644 GIT binary patch delta 75 zcmaFD_=Isnh>i%ma(kLuA_D_Mp{I*uh{WaA{*AoN4gxICozOAh&guBm)COp{I*uh{WaA{*AoN4gxIC<4rdD-cS$@7G6@qZph&y fe7kL8Lx4zHoZPHi#*TY{8W=oX{an^LB{Ts5f@&Bh diff --git a/ui/chatArea/scrollBarUpArrowHover.png b/ui/chatArea/scrollBarUpArrowHover.png index 58ee6d961e333fb1229705f895049ab88da497a6..b6f9ce109e55de84d84470203a0efbd9b9d0db22 100644 GIT binary patch delta 45 zcmcb~c$0BL2)hWI+2;kHPfv`NV=gJ`omk^3@}p3(setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); chatArea->setWidgetResizable(true); chatArea->setContextMenuPolicy(Qt::CustomContextMenu); + chatArea->setFrameStyle(QFrame::NoFrame); mainChatLayout->setColumnStretch(1,1); mainChatLayout->setSpacing(10); footButtonsSmall->setSpacing(2); + QString msgEditStylesheet = ""; + try + { + QFile f("ui/msgEdit/msgEdit.css"); + f.open(QFile::ReadOnly | QFile::Text); + QTextStream msgEditStylesheetStream(&f); + msgEditStylesheet = msgEditStylesheetStream.readAll(); + } + catch (int e) {} + msgEdit->setStyleSheet(msgEditStylesheet); msgEdit->setFixedHeight(50); + msgEdit->setFrameStyle(QFrame::NoFrame); QString sendButtonStylesheet = ""; try @@ -61,10 +73,6 @@ ChatForm::ChatForm(Friend* chatFriend) catch (int e) {} sendButton->setStyleSheet(sendButtonStylesheet); - QPalette toxgreen; - toxgreen.setColor(QPalette::Button, QColor(107,194,96)); // Tox Green - - QString fileButtonStylesheet = ""; try { diff --git a/widget/form/groupchatform.cpp b/widget/form/groupchatform.cpp index 236c9fce6..27d7aa99c 100644 --- a/widget/form/groupchatform.cpp +++ b/widget/form/groupchatform.cpp @@ -39,9 +39,39 @@ GroupChatForm::GroupChatForm(Group* chatGroup) namesList->setFont(small); chatAreaWidget->setLayout(mainChatLayout); + QString chatAreaStylesheet = ""; + try + { + QFile f("ui/chatArea/chatArea.css"); + f.open(QFile::ReadOnly | QFile::Text); + QTextStream chatAreaStylesheetStream(&f); + chatAreaStylesheet = chatAreaStylesheetStream.readAll(); + } + catch (int e) {} + chatArea->setStyleSheet(chatAreaStylesheet); chatArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); chatArea->setWidgetResizable(true); chatArea->setContextMenuPolicy(Qt::CustomContextMenu); + chatArea->setFrameStyle(QFrame::NoFrame); + + mainChatLayout->setColumnStretch(1,1); + mainChatLayout->setSpacing(10); + + + QString msgEditStylesheet = ""; + try + { + QFile f("ui/msgEdit/msgEdit.css"); + f.open(QFile::ReadOnly | QFile::Text); + QTextStream msgEditStylesheetStream(&f); + msgEditStylesheet = msgEditStylesheetStream.readAll(); + } + catch (int e) {} + msgEdit->setObjectName("group"); + msgEdit->setStyleSheet(msgEditStylesheet); + msgEdit->setFixedHeight(50); + msgEdit->setFrameStyle(QFrame::NoFrame); + mainChatLayout->setColumnStretch(1,1); mainChatLayout->setHorizontalSpacing(10); @@ -56,7 +86,6 @@ GroupChatForm::GroupChatForm(Group* chatGroup) catch (int e) {} sendButton->setStyleSheet(sendButtonStylesheet); - msgEdit->setFixedHeight(50); sendButton->setFixedSize(50, 50); main->setLayout(mainLayout);