From 63edb90cbea78dca311665522e85a1715d37bcaa Mon Sep 17 00:00:00 2001 From: Franz Fellner Date: Sun, 30 Sep 2012 10:55:44 +0200 Subject: [PATCH 1/3] Adjusted themes main.css to get a vertically centered contentsRect. Also adjusted mac siteicon-[secure]-bg.png to not have opaque pixels, which would cut content (e.g. Top progress bar). Filled bar is now drawn independent of textRect. --- bin/themes/chrome/main.css | 3 ++- bin/themes/default/main.css | 4 +++- bin/themes/linux/main.css | 3 ++- bin/themes/mac/images/siteicon-bg.png | Bin 1316 -> 1352 bytes bin/themes/mac/images/siteicon-secure-bg.png | Bin 958 -> 1003 bytes bin/themes/mac/main.css | 3 ++- bin/themes/windows/main.css | 4 +++- src/lib/navigation/locationbar.cpp | 5 +++-- 8 files changed, 15 insertions(+), 7 deletions(-) diff --git a/bin/themes/chrome/main.css b/bin/themes/chrome/main.css index cac09feaa..2ac50693e 100644 --- a/bin/themes/chrome/main.css +++ b/bin/themes/chrome/main.css @@ -124,11 +124,12 @@ IconProvider { background: transparent; border-image: url(images/lineedit-bg.png); - border-width:4; + border-width: 3px; color:black; padding-right: 0px; padding-left: 0px; padding-top: -2px; + padding-bottom: -2px; qproperty-fixedheight: 27; qproperty-leftMargin: 28; } diff --git a/bin/themes/default/main.css b/bin/themes/default/main.css index 9f8b2eee1..33a2d568a 100644 --- a/bin/themes/default/main.css +++ b/bin/themes/default/main.css @@ -134,10 +134,12 @@ IconProvider { background: transparent; border-image: url(images/lineedit-bg.png); - border-width:4; + border-width: 4px; color:black; padding-right: -2px; padding-left: -2px; + padding-top: -2px; + padding-bottom: -2px; qproperty-fixedheight: 25; qproperty-leftMargin: 35; } diff --git a/bin/themes/linux/main.css b/bin/themes/linux/main.css index 20f8ea77b..7f70587be 100644 --- a/bin/themes/linux/main.css +++ b/bin/themes/linux/main.css @@ -115,10 +115,11 @@ IconProvider /*LocationBar*/ #locationbar { - border-width:4; + border-width: 4px; padding-right: -4px; padding-left: -4px; padding-top: -2px; + padding-bottom: -2px; qproperty-fixedheight: 27; qproperty-leftMargin: 26; } diff --git a/bin/themes/mac/images/siteicon-bg.png b/bin/themes/mac/images/siteicon-bg.png index 5f689a965ed4384bc0a5c0cbe5839f705d1a864a..ae081755070bfb4e378dfd565781bd1cb4c16df1 100644 GIT binary patch delta 1291 zcmV+m1@!u)3djnOB#|*Kf7}Tk2sAetdNXMN00h-ZL_t(Y$HkY;Ya2%x#(%RP(Ms$} z#?glpBx4J=af3x2YMdO?TQ3SU=NjL7$RYIBUVH4VB(VAiPfkvF^ym@QYLzQju5jbV4GM(__$B!NCD{?yOL+*O;3tQ7GiA zuImzu#lGnft<`F*f2^!fE|*zeUgk{f4DD764F~`PT4*{Q8V~}s4jzL};iJ($(1&!@ zC4zMVls`|y!NFhrdiyrwapQW{+{! z(a{k*J3HLGc@rfi1Vl7LoDm*3A%F-zI*dRrl*?tBvNnGCM$R!!6V12`B; z^xeC6oIiga*=(XkWXJHxL`X$Mj!}2ROLU`13(*NYf33rnG(<9o-x**v93LMuIXOuz z7W-BRF|w*y?RFc-iP4mDP>`L-iAF>~vM)Nc@C^v8^>JGCNQS6^!MtX(iR-#pmi60d zp0`ZXL`sQam?I$lF*>l_hh(i&n`K!Dar#6n9*8ng(MkhS$p2{TfwI@Q&j;KuCL=3iVv%kMj zp-?#8qs3y87cX8gH8m9#n}5KOd!I%$K*Z3RqjfaM2DPC3bmBNM_V)HrN_}mb=8wS9 zP@+>)Q&cJy-oAZ{=OsH!`J0Krt2&a5=>7}sf9FG?dy7OQ$p@(;VqD;WU>)1C*?aSb zTCMiU#Kgp;5MpCw)L*!8f%WxuE?-{kR?qMyB)WH`GDV4X@jbxc*Oii=1?Z_vpmE|3 z&!0aholgH?+xB8~H*f#|1f)qsK~zY`#g|QM z6iFDze>L6h^bFlIAXcu{Z4im#Niil*{ErNY@oEfRvI44<2y+`gN{dy9PjCDYC~2 zOZTDpqfJ|~PQz(yO#uDA;^D)GoUBx6Hk(wdiMu_|6T%$k0z7^ClnbjDXkER3ic-p) zk-bD~ZLDFI7{QosveigCzC6-TdVg+i(vSPB{kq27+#Ep=2*+_U%DG>@d|_v2hg-L9 zp`-*Oh-QK@Qg@RAu<-WA%tAUc+l561fs_&3+uJl(R;btOgkd-_Xx(;gh7au zYM`l386{G8T6WMww+$UR!XV((sZ#_&Fg3Hd@87?t z)oKyRXlyZa;lyk!5UEmAF~_&v-Ce5HDnSrn+&z)}?$@thIeq#xGK$c`x-oT`NJSBr z8}%@}#4w7q5QD(eIz35)l{u10gVpfu+c(afIYU05M+h-hAvca=d_PZrB;`0E2a#h( zgb{KiIFxnw zj@EXNjT=di@Wl7??CtHLl)`bGsaACt78cmr+T!!)&xB!Va8z=cFjm!8GGh2IbdnE+ z&K3zP$(z(+DQ65|&hcE2y-%O$bUMt<%}wR18^L~jSYKbKUat>c^Mw7)*zl4BhX?XdP3p*J(6Q8kEcBte|Oa55o}8^LYLG zH6K5I{NFzA=I7@r7K?;oIR0^`wWinWk;~;+TwLV*`SZB0JI0xx-Tnq`_H6k<1`=KX O0000 diff --git a/bin/themes/mac/images/siteicon-secure-bg.png b/bin/themes/mac/images/siteicon-secure-bg.png index e7b09b46bede84ebf7d73668417dde51ab6f691d..4062461591996543a5113283de97fd0ca2b895f3 100644 GIT binary patch delta 939 zcmV;c162IJ2kQrrB#|*Kf7}Tk2sIxy)T+_|00VeQL_t(Y$Hmt_Y#U`5$MLW4-t)Qc zYo8O_XNSaU98`i+T(=aWBEdotov4IBf=nzZD@YwmB?dMIBvyt_Swj|#5KIYD777HB zl0uZYC2mQYxUu87@!#{^F`%Fjk}`3Aq?_(HeDuE0bGpZu&*xo^f2dlm#=^n^#bS|m zyG^}b$LlgplRzLqFc?G}e%WrfnVXxVP*~;imFIcmowtcb`-w(lp5VG&n_EBL;isDg zWKa?}@1X5!sTy!7&O?Ad=%ZZ$l+=2pYu`!9Dfq{+n#&tRJ7s$m!( z>bgEBgs2Jt%d*Jl^Gsg7LgxGvY`2ziaXdr14lI4!X22XKo6QoB$0x(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A0VmIfzEn=mk~ldH=6(=7z|=QG6@*dfjY{7;qbr9P8f!Pd1S)H z(Nv%#rAw#NA(zW}!1>Lzu&}`0y<-A%r&ED;0}YzZCbn&(D9ZU6ou8j)`_^sx4?*a* z@6e8DaC~w|yWJ+8PM=$=!gXC1UtZ$=Z#_a+52sP390sb~xsxFtk9(?rsxqkrgy(q_ z3I+DQ+oNCaBl2zEsrzb`Nc$4o+cAp8;>77B08G=QTrP9#o39y;6y${_$ey3qKEG?< zqt-&$woR#2dM2~dN=zW~bdH9sOU Ry Date: Sun, 30 Sep 2012 11:22:28 +0200 Subject: [PATCH 2/3] Also adjust websearchbar --- bin/themes/chrome/main.css | 3 ++- bin/themes/default/main.css | 4 +++- bin/themes/linux/main.css | 3 ++- bin/themes/mac/main.css | 3 ++- bin/themes/windows/main.css | 10 ++++++---- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/bin/themes/chrome/main.css b/bin/themes/chrome/main.css index 2ac50693e..c5c0ec23d 100644 --- a/bin/themes/chrome/main.css +++ b/bin/themes/chrome/main.css @@ -204,11 +204,12 @@ IconProvider { background: transparent; border-image: url(images/lineedit-bg.png); - border-width:4; + border-width: 3px; color:black; padding-right: 0px; padding-left: 0px; padding-top: -2px; + padding-bottom: -2px; qproperty-fixedheight: 27; qproperty-leftMargin: 35; } diff --git a/bin/themes/default/main.css b/bin/themes/default/main.css index 33a2d568a..e4d3667c4 100644 --- a/bin/themes/default/main.css +++ b/bin/themes/default/main.css @@ -189,9 +189,11 @@ IconProvider { background: transparent; border-image: url(images/lineedit-bg.png); - border-width:4; + border-width: 4px; color:black; padding-right: -2px; + padding-top: -2px; + padding-bottom: -2px; qproperty-fixedheight: 25; qproperty-leftMargin: 34; } diff --git a/bin/themes/linux/main.css b/bin/themes/linux/main.css index 7f70587be..96860266a 100644 --- a/bin/themes/linux/main.css +++ b/bin/themes/linux/main.css @@ -188,9 +188,10 @@ IconProvider /*WebSearchBar*/ #websearchbar { - border-width:4; + border-width: 4px; padding-right: -4px; padding-top: -2px; + padding-bottom: -2px; qproperty-fixedheight: 27; qproperty-leftMargin: 30; } diff --git a/bin/themes/mac/main.css b/bin/themes/mac/main.css index be854b629..807cb0c2e 100644 --- a/bin/themes/mac/main.css +++ b/bin/themes/mac/main.css @@ -199,9 +199,10 @@ IconProvider { background: transparent; border-image: url(images/lineedit-bg.png); - border-width: 4; + border-width: 4px; padding-right: -4px; padding-top: -2px; + padding-bottom: -2px; color:black; qproperty-fixedheight: 23; qproperty-leftMargin: 35; diff --git a/bin/themes/windows/main.css b/bin/themes/windows/main.css index 0a0b87859..56c5c7334 100644 --- a/bin/themes/windows/main.css +++ b/bin/themes/windows/main.css @@ -131,8 +131,8 @@ IconProvider border-image: url(images/lineedit-bg.png); border-width: 3px; color:black; - padding-right: -4px; - padding-left: -4px; + padding-right: -3px; + padding-left: -3px; padding-top: -2px; padding-bottom: -2px; qproperty-fixedheight: 22; @@ -210,9 +210,11 @@ IconProvider { background: transparent; border-image: url(images/lineedit-bg.png); - border-width:4; + border-width: 3px; color:black; - padding-right: -4px; + padding-right: -3px; + padding-top: -2px; + padding-bottom: -2px; qproperty-fixedheight: 22; qproperty-leftMargin: 30; } From 204e942f872b31c5f1c656371e03a62b25b0fb4b Mon Sep 17 00:00:00 2001 From: Franz Fellner Date: Mon, 1 Oct 2012 11:26:07 +0200 Subject: [PATCH 3/3] Cleanup in NavigationBar and WebSearchBar: * move helper-functions in navigationbar.cpp into NavigationBar [private] * remove (unused) 2nd arg in WebSearchBar/NavigationBar and use mainClass as parent. * remove NavigationBar-destructor (not needed) * remove WebSearchBar::m_menu and create a QMenu-instance directly in WebSearchBar::contextMenuEvent() --- src/lib/navigation/navigationbar.cpp | 13 ++++--------- src/lib/navigation/navigationbar.h | 8 ++++++-- src/lib/navigation/websearchbar.cpp | 27 +++++++++++++-------------- src/lib/navigation/websearchbar.h | 3 +-- 4 files changed, 24 insertions(+), 27 deletions(-) diff --git a/src/lib/navigation/navigationbar.cpp b/src/lib/navigation/navigationbar.cpp index 7f37272bc..d468beca1 100644 --- a/src/lib/navigation/navigationbar.cpp +++ b/src/lib/navigation/navigationbar.cpp @@ -34,7 +34,7 @@ #include #include -QString titleForUrl(QString title, const QUrl &url) +QString NavigationBar::titleForUrl(QString title, const QUrl &url) { if (title.isEmpty()) { title = url.toString(QUrl::RemoveFragment); @@ -50,7 +50,7 @@ QString titleForUrl(QString title, const QUrl &url) return title; } -QIcon iconForPage(const QUrl &url, const QIcon &sIcon) +QIcon NavigationBar::iconForPage(const QUrl &url, const QIcon &sIcon) { QIcon icon; icon.addPixmap(url.scheme() == QLatin1String("qupzilla") ? QIcon(":icons/qupzilla.png").pixmap(16, 16) : _iconForUrl(url).pixmap(16, 16)); @@ -58,8 +58,8 @@ QIcon iconForPage(const QUrl &url, const QIcon &sIcon) return icon; } -NavigationBar::NavigationBar(QupZilla* mainClass, QWidget* parent) - : QWidget(parent) +NavigationBar::NavigationBar(QupZilla* mainClass) + : QWidget(mainClass) , p_QupZilla(mainClass) { setObjectName("navigationbar"); @@ -356,8 +356,3 @@ void NavigationBar::goForwardInNewTab() goAtHistoryIndexInNewTab(itemIndex); } - -NavigationBar::~NavigationBar() -{ - delete m_searchLine; -} diff --git a/src/lib/navigation/navigationbar.h b/src/lib/navigation/navigationbar.h index 8a1a88b53..0c5ef7a57 100644 --- a/src/lib/navigation/navigationbar.h +++ b/src/lib/navigation/navigationbar.h @@ -30,12 +30,13 @@ class WebSearchBar; class QupZilla; class ReloadStopButton; class Menu; +class QUrl; + class QT_QUPZILLA_EXPORT NavigationBar : public QWidget { Q_OBJECT public: - explicit NavigationBar(QupZilla* mainClass, QWidget* parent = 0); - ~NavigationBar(); + explicit NavigationBar(QupZilla* mainClass); void setSplitterSizes(int locationBar, int websearchBar); @@ -71,6 +72,9 @@ private slots: void clearHistory(); private: + QString titleForUrl(QString title, const QUrl &url); + QIcon iconForPage(const QUrl &url, const QIcon &sIcon); + QupZilla* p_QupZilla; QHBoxLayout* m_layout; diff --git a/src/lib/navigation/websearchbar.cpp b/src/lib/navigation/websearchbar.cpp index ebc36a425..b2868ea8b 100644 --- a/src/lib/navigation/websearchbar.cpp +++ b/src/lib/navigation/websearchbar.cpp @@ -50,10 +50,9 @@ void WebSearchBar_Button::contextMenuEvent(QContextMenuEvent* event) event->accept(); } -WebSearchBar::WebSearchBar(QupZilla* mainClass, QWidget* parent) - : LineEdit(parent) +WebSearchBar::WebSearchBar(QupZilla* mainClass) + : LineEdit(mainClass) , p_QupZilla(mainClass) - , m_menu(new QMenu(this)) , m_pasteAndGoAction(0) , m_clearAction(0) , m_reloadingEngines(false) @@ -266,13 +265,13 @@ void WebSearchBar::contextMenuEvent(QContextMenuEvent* event) } QMenu* tempMenu = createStandardContextMenu(); - m_menu->clear(); + QMenu menu(this); int i = 0; foreach(QAction * act, tempMenu->actions()) { - act->setParent(m_menu); + act->setParent(&menu); tempMenu->removeAction(act); - m_menu->addAction(act); + menu.addAction(act); switch (i) { case 0: @@ -289,13 +288,13 @@ void WebSearchBar::contextMenuEvent(QContextMenuEvent* event) break; case 5: act->setIcon(QIcon::fromTheme("edit-paste")); - m_menu->addAction(act); - m_menu->addAction(m_pasteAndGoAction); + menu.addAction(act); + menu.addAction(m_pasteAndGoAction); break; case 6: act->setIcon(QIcon::fromTheme("edit-delete")); - m_menu->addAction(act); - m_menu->addAction(m_clearAction); + menu.addAction(act); + menu.addAction(m_clearAction); break; case 8: act->setIcon(QIcon::fromTheme("edit-select-all")); @@ -306,13 +305,13 @@ void WebSearchBar::contextMenuEvent(QContextMenuEvent* event) tempMenu->deleteLater(); - m_menu->addSeparator(); - QAction* act = m_menu->addAction(tr("Show suggestions")); + menu.addSeparator(); + QAction* act = menu.addAction(tr("Show suggestions")); act->setCheckable(true); act->setChecked(qzSettings->showSearchSuggestions); connect(act, SIGNAL(triggered(bool)), this, SLOT(enableSearchSuggestions(bool))); - QAction* instantSearch = m_menu->addAction(tr("Search when engine changed")); + QAction* instantSearch = menu.addAction(tr("Search when engine changed")); instantSearch->setCheckable(true); instantSearch->setChecked(qzSettings->searchOnEngineChange); connect(instantSearch, SIGNAL(triggered(bool)), this, SLOT(instantSearchChanged(bool))); @@ -322,7 +321,7 @@ void WebSearchBar::contextMenuEvent(QContextMenuEvent* event) //Prevent choosing first option with double rightclick QPoint pos = event->globalPos(); QPoint p(pos.x(), pos.y() + 1); - m_menu->popup(p); + menu.exec(p); } void WebSearchBar::focusOutEvent(QFocusEvent* e) diff --git a/src/lib/navigation/websearchbar.h b/src/lib/navigation/websearchbar.h index baff041c6..4f7891562 100644 --- a/src/lib/navigation/websearchbar.h +++ b/src/lib/navigation/websearchbar.h @@ -52,7 +52,7 @@ class QT_QUPZILLA_EXPORT WebSearchBar : public LineEdit Q_PROPERTY(int fixedheight READ height WRITE setFixedHeight) public: - explicit WebSearchBar(QupZilla* mainClass, QWidget* parent = 0); + explicit WebSearchBar(QupZilla* mainClass); private slots: void searchChanged(const ButtonWithMenu::Item &item); @@ -93,7 +93,6 @@ private: SearchEnginesManager* m_searchManager; QWeakPointer m_searchDialog; - QMenu* m_menu; QAction* m_pasteAndGoAction; QAction* m_clearAction;