From 132629199fa69a07650d5dac31d7751c8e73ba8c Mon Sep 17 00:00:00 2001 From: megabigbug Date: Mon, 27 Jul 2009 18:47:30 +0200 Subject: Add a setBackgroundColor to urlbar Change the urlbar color by the window color when private browsing Change the urlbar color by a light red color when web inspector activated --- src/mainwindow.cpp | 7 +++++++ src/urlbar.cpp | 6 ++++++ src/urlbar.h | 1 + 3 files changed, 14 insertions(+) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 9a1ea708..e506bb4e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -590,6 +590,7 @@ void MainWindow::slotPrivateBrowsing(bool enable) if (button == KMessageBox::Yes) { settings->setAttribute(QWebSettings::PrivateBrowsingEnabled, true); + m_view->currentUrlBar()->setBackgroundColor(palette().color(QPalette::Active, QPalette::Background)); } else { @@ -599,6 +600,7 @@ void MainWindow::slotPrivateBrowsing(bool enable) else { settings->setAttribute(QWebSettings::PrivateBrowsingEnabled, false); + m_view->currentUrlBar()->setBackgroundColor(palette().color(QPalette::Active, QPalette::Base)); MainWindow* win = Application::instance()->mainWindow(); win->m_lastSearch.clear(); @@ -751,9 +753,14 @@ void MainWindow::slotToggleInspector(bool enable) if (result == KMessageBox::Yes) { + m_view->currentUrlBar()->setBackgroundColor(QColor(247, 230, 230)); m_view->slotReloadAllTabs(); } } + else + { + m_view->currentUrlBar()->setBackgroundColor(palette().color(QPalette::Active, QPalette::Base)); + } } diff --git a/src/urlbar.cpp b/src/urlbar.cpp index af336e1c..ba9773db 100644 --- a/src/urlbar.cpp +++ b/src/urlbar.cpp @@ -258,3 +258,9 @@ QLinearGradient UrlBar::generateGradient(const QColor &color, int height) gradient.setColorAt(1, base); return gradient; } + +void UrlBar::setBackgroundColor(QColor c) +{ + s_defaultBaseColor=c; + repaint(); +} \ No newline at end of file diff --git a/src/urlbar.h b/src/urlbar.h index 24fea38f..a943c916 100644 --- a/src/urlbar.h +++ b/src/urlbar.h @@ -52,6 +52,7 @@ public: void selectAll() const; KUrl url() const; QSize sizeHint() const; + void setBackgroundColor(QColor); signals: void activated(const KUrl&); -- cgit v1.2.1 From 26975949009a0ade4b095f6e8c2ab36cdc764599 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 28 Jul 2009 00:02:17 +0200 Subject: Removed Web Inspecting color Fixed a bit PrivateBrowsingEnabled FALSE Changed background color to LIGHTGRAY to let it be a little different from mainwindow color --- src/mainwindow.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index e506bb4e..a862ee95 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -67,8 +67,6 @@ #include - - // Qt Includes #include #include @@ -590,7 +588,7 @@ void MainWindow::slotPrivateBrowsing(bool enable) if (button == KMessageBox::Yes) { settings->setAttribute(QWebSettings::PrivateBrowsingEnabled, true); - m_view->currentUrlBar()->setBackgroundColor(palette().color(QPalette::Active, QPalette::Background)); + m_view->currentUrlBar()->setBackgroundColor(Qt::lightGray); // palette().color(QPalette::Active, QPalette::Background)); } else { @@ -602,9 +600,9 @@ void MainWindow::slotPrivateBrowsing(bool enable) settings->setAttribute(QWebSettings::PrivateBrowsingEnabled, false); m_view->currentUrlBar()->setBackgroundColor(palette().color(QPalette::Active, QPalette::Base)); - MainWindow* win = Application::instance()->mainWindow(); - win->m_lastSearch.clear(); - win->mainView()->clear(); + m_lastSearch.clear(); + m_view->clear(); + m_view->slotReloadAllTabs(); } } @@ -753,14 +751,9 @@ void MainWindow::slotToggleInspector(bool enable) if (result == KMessageBox::Yes) { - m_view->currentUrlBar()->setBackgroundColor(QColor(247, 230, 230)); m_view->slotReloadAllTabs(); } } - else - { - m_view->currentUrlBar()->setBackgroundColor(palette().color(QPalette::Active, QPalette::Base)); - } } -- cgit v1.2.1