From 5cf6b1c5653f410c05c87902549291f2dcca0a67 Mon Sep 17 00:00:00 2001 From: nowrep Date: Wed, 12 Sep 2012 11:59:23 +0200 Subject: [PATCH] Fixed color of text in labels in SiteInfo/Bookmarks/RSS urlbar popup. - using tooltip text color with gtk+ and besping styles --- src/lib/bookmarks/bookmarkswidget.cpp | 8 ++++++++ src/lib/rss/rsswidget.cpp | 18 ++++++++---------- src/lib/webview/siteinfowidget.cpp | 15 ++++++++------- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/src/lib/bookmarks/bookmarkswidget.cpp b/src/lib/bookmarks/bookmarkswidget.cpp index c06128c28..4e6d01267 100644 --- a/src/lib/bookmarks/bookmarkswidget.cpp +++ b/src/lib/bookmarks/bookmarkswidget.cpp @@ -53,6 +53,14 @@ BookmarksWidget::BookmarksWidget(QupZilla* mainClass, WebView* view, QWidget* pa tr("Remove from Speed Dial")); loadBookmark(); + + if (mApp->currentStyle() == "gtk+" || mApp->currentStyle() == "bespin") { + // Use light color for QLabels with problematic styles + QPalette pal = palette(); + pal.setColor(QPalette::WindowText, QToolTip::palette().color(QPalette::ToolTipText)); + ui->label->setPalette(pal); + ui->label_2->setPalette(pal); + } } void BookmarksWidget::loadBookmark() diff --git a/src/lib/rss/rsswidget.cpp b/src/lib/rss/rsswidget.cpp index da4be9ba9..2defdd7d2 100644 --- a/src/lib/rss/rsswidget.cpp +++ b/src/lib/rss/rsswidget.cpp @@ -34,13 +34,6 @@ RSSWidget::RSSWidget(WebView* view, QWidget* parent) { ui->setupUi(this); -#ifndef KDE - // Use light color for QLabels even with Ubuntu Ambiance theme - QPalette pal = palette(); - pal.setColor(QPalette::WindowText, QToolTip::palette().color(QPalette::ToolTipText)); - ui->label_2->setPalette(pal); -#endif - QWebFrame* frame = m_view->page()->mainFrame(); QWebElementCollection links = frame->findAllElements("link[type=\"application/rss+xml\"]"); @@ -61,14 +54,19 @@ RSSWidget::RSSWidget(WebView* view, QWidget* parent) button->setToolTip(title); button->setProperty("rss-url", url); QLabel* label = new QLabel(this); -#ifndef KDE - label->setPalette(pal); -#endif label->setText(title); ui->gridLayout->addWidget(label, i, 0); ui->gridLayout->addWidget(button, i, 1); connect(button, SIGNAL(clicked()), this, SLOT(addRss())); + + if (mApp->currentStyle() == "gtk+" || mApp->currentStyle() == "bespin") { + // Use light color for QLabels with problematic styles + QPalette pal = palette(); + pal.setColor(QPalette::WindowText, QToolTip::palette().color(QPalette::ToolTipText)); + ui->label_2->setPalette(pal); + label->setPalette(pal); + } } } diff --git a/src/lib/webview/siteinfowidget.cpp b/src/lib/webview/siteinfowidget.cpp index 1596f05d7..f0d5eb0eb 100644 --- a/src/lib/webview/siteinfowidget.cpp +++ b/src/lib/webview/siteinfowidget.cpp @@ -18,6 +18,7 @@ #include "siteinfowidget.h" #include "ui_siteinfowidget.h" #include "qupzilla.h" +#include "mainapplication.h" #include "webpage.h" #include "tabbedwebview.h" @@ -80,13 +81,13 @@ SiteInfoWidget::SiteInfoWidget(QupZilla* mainClass, QWidget* parent) } connect(ui->pushButton, SIGNAL(clicked()), p_QupZilla, SLOT(showPageInfo())); -#ifndef KDE - // Use light color for QLabels even with Ubuntu Ambiance theme - QPalette pal = palette(); - pal.setColor(QPalette::WindowText, QToolTip::palette().color(QPalette::ToolTipText)); - ui->historyLabel->setPalette(pal); - ui->secureLabel->setPalette(pal); -#endif + if (mApp->currentStyle() == "gtk+" || mApp->currentStyle() == "bespin") { + // Use light color for QLabels with problematic styles + QPalette pal = palette(); + pal.setColor(QPalette::WindowText, QToolTip::palette().color(QPalette::Inactive, QPalette::ToolTipText)); + ui->historyLabel->setPalette(pal); + ui->secureLabel->setPalette(pal); + } } void SiteInfoWidget::showAt(QWidget* _parent)