From f6f604698dee2ef02ceebb00236830c2fed4a4bd Mon Sep 17 00:00:00 2001 From: "S. Razi Alavizadeh" Date: Sun, 3 Mar 2013 23:34:21 +0330 Subject: [PATCH] [Win] Improved "windows" theme+transparent TabBar's background --- bin/themes/chrome/images/toolbar-bg.png | Bin 254 -> 247 bytes bin/themes/windows/images/tab-active-bg.png | Bin 0 -> 194 bytes bin/themes/windows/images/tab-deactive-bg.png | Bin 0 -> 159 bytes bin/themes/windows/images/toolbar-bg.png | Bin 157 -> 245 bytes bin/themes/windows/rtl.css | 5 +++ bin/themes/windows/windows.css | 31 ++++++++++++++++++ src/lib/app/qupzilla.cpp | 7 ++++ src/lib/webview/tabwidget.cpp | 2 ++ 8 files changed, 45 insertions(+) create mode 100644 bin/themes/windows/images/tab-active-bg.png create mode 100644 bin/themes/windows/images/tab-deactive-bg.png diff --git a/bin/themes/chrome/images/toolbar-bg.png b/bin/themes/chrome/images/toolbar-bg.png index 7d707527589684fea86951ffd9cf09921f2d6fab..bc38e0eaaa044c92dd4ac8344256a39aac127ea6 100644 GIT binary patch delta 206 zcmV;<05Sjm0rvrr7YcL;1^@s6qSKSVkw6}Q-2(#(1|V0$a`ylL0G3HaK~y-))swLf zfItXCTXX;au`W&qS3?sE7zY^}Ahh?6`*8+twIP)VD5+NHiD3)Ty1MpU48 z>jEmAj+B^OT3SjYs26(s{wco*2-ypbm(pQQP(J)f!HY@V=TU(_+B-&!eE>fh&%%T` zb&&0Mk$|Gjn0#d9#E{X}5sJ`dY?hd@KY?EZ>O+V3|K-QR1z)*XFz1tsaR2}S07*qo IM6N<$f(0;F-v9sr delta 213 zcmey)_>XadxMmaw69WT-fOx_>AjMc5hx zh+}&8&gqCusMNtp3;I|DULD`kzp9vJA**uaiJ2?(o(k+!Fk#xXq|IT0+XVYqNgI*y z)-t)rZ~MDS4kodE*xP#ZnU=bgiSkpaC6g6j%Cqg!Em2soX@2|x*3XxnFaM~LJq>gU NgQu&X%Q~loCIBx?QxyOJ diff --git a/bin/themes/windows/images/tab-active-bg.png b/bin/themes/windows/images/tab-active-bg.png new file mode 100644 index 0000000000000000000000000000000000000000..1ad7560f958a238e1940931850c2a3854433552b GIT binary patch literal 194 zcmeAS@N?(olHy`uVBq!ia0vp^EI=&F!3HFIHO}e+Db50q$YKTtZeb8+WSBKa0w~B{ z;_2(kewUe-U;4(4GtX6@x0&d4V_~Zgdazxx_VXCq};yq z=z(B9$Hr3}1_}ycVd;-gJYDCld?ht6{fW^cgDf{|2MPWwLCFm#jBZp1rQGZPYLK>e n?~DUyv)JzG&bN6X|ByxaoaL)21zppCmN9s``njxgN@xNAkD@*N literal 0 HcmV?d00001 diff --git a/bin/themes/windows/images/tab-deactive-bg.png b/bin/themes/windows/images/tab-deactive-bg.png new file mode 100644 index 0000000000000000000000000000000000000000..8a33fc1f645328cd4094d9a977a8a79a26245023 GIT binary patch literal 159 zcmeAS@N?(olHy`uVBq!ia0vp^Y(Ol|!2~3itE^N6Qk(@Ik;M!Qe1}1p@p%4<6rdn` ziKnkC`(0*6aShpBQRkC@LUx`mjv*44lmC2v&d;os@blYS=~)88%xnoi|NpnIbo&4A zud@H+<^JbP0l+XkK D;ubML literal 0 HcmV?d00001 diff --git a/bin/themes/windows/images/toolbar-bg.png b/bin/themes/windows/images/toolbar-bg.png index 1a0fbb5571fa20330b75443437ab4d5eb97d5523..7a3c8efdc14fa0e10781aab3f6c3564b40db025a 100644 GIT binary patch delta 230 zcmbQs_?2;jczp>68v_HwqRW%_11ZMhAa^H*b?0PW0y!+{j=qiz3>*8o|0J>k`J4qF zk;M!Qd`Cc-ajG_-G*Gb1)5S5w!~5+NZ>|Od9+%m7{+GSm(=6>6`0{w+)1JGXj}D2+ zO;LQAKIvMKp6Z1SGd6L(o)$7=`iesqxk?pIY>(pwnVLI#I)v@ZQrEm@kDcOQd1f!? zqXXyv7;rZp{JKye&UL|c=Fi5*?W*+6xl&IgMlIY@cD7&q&x%>+KF-&;zHLp=yhvwz eGi`~Q`?8xdB8+ExEmZ_Mi^0>?&t;ucLK6TYSX<`+ delta 142 zcmV;90CE5I0i6Mm7k^p^1^@s6pLO^700001b5ch_0Itp)=>Px#S4l)cR5;7+(lHLe zFbD%cJL3OOtvYrHq-*00L>;;mwwy3SWJZjE$C$if?g}B$J(5UYZY&W!dYsn;4Kf9P w1|tOkCL0u~KP~v6r&7z7)p7$~-Iyacqb(ns(6kzr00000Ne4wvM6N<$f-XQaQvd(} diff --git a/bin/themes/windows/rtl.css b/bin/themes/windows/rtl.css index 6c699bc25..f54eda666 100644 --- a/bin/themes/windows/rtl.css +++ b/bin/themes/windows/rtl.css @@ -17,3 +17,8 @@ { qproperty-multiIcon: url(images/tabbar-addtab_rtl.png); } + +#tabbar::tab:last +{ + margin-left: 1px; +} diff --git a/bin/themes/windows/windows.css b/bin/themes/windows/windows.css index ee1fc599c..ed1dbfd89 100644 --- a/bin/themes/windows/windows.css +++ b/bin/themes/windows/windows.css @@ -7,11 +7,42 @@ max-height: 27px; } +#tab-icon +{ + padding-right: 3px; + padding-left: 3px; + min-width: 16px; + max-width: 16px; +} + #tabbar::tab { height: 26px; } +#tabbar::tab:selected +{ + background : url(images/tab-active-bg.png) repeat-x; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + border: 1px solid #606060; + border-bottom: none; +} + +#tabbar::tab:!selected +{ + background: url(images/tab-deactive-bg.png) repeat-x; + margin-top: 2px; + margin-bottom: -3px; + border: 1px solid #a6a6a6; +} + +#tabbar::tab:last +{ + margin-right: -1px; +} + + /*Downloads*/ DownloadItem #progressBar { diff --git a/src/lib/app/qupzilla.cpp b/src/lib/app/qupzilla.cpp index 95985302a..041d6de6a 100644 --- a/src/lib/app/qupzilla.cpp +++ b/src/lib/app/qupzilla.cpp @@ -744,6 +744,7 @@ void QupZilla::loadSettings() if (m_usingTransparentBackground && !makeTransparent) { QtWin::extendFrameIntoClientArea(this, 0, 0, 0, 0); QtWin::enableBlurBehindWindow(this, false); + QtWin::enableBlurBehindWindow(m_tabWidget->getTabBar(), false); m_usingTransparentBackground = false; } #endif @@ -770,6 +771,9 @@ void QupZilla::loadSettings() m_usingTransparentBackground = true; + if (!qzSettings->tabsOnTop) { + QtWin::enableBlurBehindWindow(m_tabWidget->getTabBar(), true); + } applyBlurToMainWindow(); update(); @@ -1591,6 +1595,9 @@ void QupZilla::triggerTabsOnTop(bool enable) Settings settings; settings.setValue("Browser-Tabs-Settings/TabsOnTop", enable); + if (m_usingTransparentBackground) { + QtWin::enableBlurBehindWindow(m_tabWidget->getTabBar(), !enable); + } qzSettings->tabsOnTop = enable; } diff --git a/src/lib/webview/tabwidget.cpp b/src/lib/webview/tabwidget.cpp index 76fd49612..6c5736499 100644 --- a/src/lib/webview/tabwidget.cpp +++ b/src/lib/webview/tabwidget.cpp @@ -471,6 +471,7 @@ void TabWidget::startTabAnimation(int index) QLabel* label = qobject_cast(m_tabBar->tabButton(index, m_tabBar->iconButtonPosition())); if (!label) { label = new QLabel(); + label->setObjectName("tab-icon"); m_tabBar->setTabButton(index, m_tabBar->iconButtonPosition(), label); } @@ -515,6 +516,7 @@ void TabWidget::setTabIcon(int index, const QIcon &icon) QLabel* label = qobject_cast(m_tabBar->tabButton(index, m_tabBar->iconButtonPosition())); if (!label) { label = new QLabel(); + label->setObjectName("tab-icon"); label->resize(16, 16); m_tabBar->setTabButton(index, m_tabBar->iconButtonPosition(), label); }