diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mainview.cpp | 1 | ||||
-rw-r--r-- | src/mainwindow.cpp | 2 | ||||
-rw-r--r-- | src/mainwindow.h | 4 | ||||
-rw-r--r-- | src/urlbar/urlbar.cpp | 11 | ||||
-rw-r--r-- | src/webtab.cpp | 1 | ||||
-rw-r--r-- | src/webtab.h | 3 | ||||
-rw-r--r-- | src/webview.cpp | 17 | ||||
-rw-r--r-- | src/webview.h | 2 |
8 files changed, 35 insertions, 6 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp index 84dc70af..0b17ef2a 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -329,6 +329,7 @@ WebTab *MainView::newWebTab(bool focused, bool nearParent) connect(tab->view(), SIGNAL(iconChanged()), this, SLOT(webViewIconChanged())); connect(tab->view(), SIGNAL(titleChanged(const QString &)), this, SLOT(webViewTitleChanged(const QString &))); connect(tab->view(), SIGNAL(urlChanged(const QUrl &)), this, SLOT(webViewUrlChanged(const QUrl &))); + connect(tab->view(), SIGNAL(zoomChanged(qreal)), m_parentWindow, SLOT(setZoomSliderFactor(qreal))); // connecting webPage signals with mainview connect(tab->view()->page(), SIGNAL(windowCloseRequested()), this, SLOT(windowCloseRequested())); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d5b81c1e..dc29d2eb 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -906,7 +906,7 @@ void MainWindow::setZoomFactor(int factor) void MainWindow::setZoomSliderFactor(qreal factor) { - m_zoomSlider->setValue(factor*10); + m_zoomSlider->setValue(factor * 10); } diff --git a/src/mainwindow.h b/src/mainwindow.h index ffc91086..8acbef56 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -78,8 +78,6 @@ public: virtual QSize sizeHint() const; void setWidgetsVisible(bool makeFullScreen); - void setZoomSliderFactor(qreal factor); - private: void setupActions(); void setupTools(); @@ -103,6 +101,8 @@ public slots: void updateActions(); + void setZoomSliderFactor(qreal factor); + signals: // switching tabs void ctrlTabPressed(); diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index 4d38f170..5428ca33 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -101,6 +101,8 @@ UrlBar::UrlBar(QWidget *parent) _tab = qobject_cast<WebTab *>(parent); + connect(_tab, SIGNAL(loadProgressing()), this, SLOT(update())); + connect(_tab->view(), SIGNAL(urlChanged(const QUrl &)), this, SLOT(setQUrl(const QUrl &))); connect(_tab->view(), SIGNAL(loadFinished(bool)), this, SLOT(loadFinished())); connect(_tab->view(), SIGNAL(loadStarted()), this, SLOT(clearRightIcons())); @@ -152,7 +154,7 @@ void UrlBar::activated(const KUrl& url, Rekonq::OpenType type) void UrlBar::paintEvent(QPaintEvent *event) -{ +{ QColor backgroundColor; if (_privateMode) { @@ -177,10 +179,13 @@ void UrlBar::paintEvent(QPaintEvent *event) } else { - QColor loadingColor = QColor(116, 192, 250); + // NOTE: I chose this instead of the old QColor(116, 192, 250) + // to try respecting style colors + QColor loadingColor = Application::palette().color(QPalette::ToolTipBase); - QLinearGradient gradient(0, 0, width(), 0); + QLinearGradient gradient( QPoint(0, 0), QPoint(width(), height()) ); gradient.setColorAt(0, loadingColor); + gradient.setColorAt(((double)progr) / 100 - .000001, loadingColor); gradient.setColorAt(((double)progr) / 100, backgroundColor); p.setBrush(QPalette::Base, gradient); } diff --git a/src/webtab.cpp b/src/webtab.cpp index 47780a44..9e168d36 100644 --- a/src/webtab.cpp +++ b/src/webtab.cpp @@ -124,6 +124,7 @@ KUrl WebTab::url() void WebTab::updateProgress(int p) { m_progress = p; + emit loadProgressing(); } diff --git a/src/webtab.h b/src/webtab.h index bc07a3e9..e34bbccf 100644 --- a/src/webtab.h +++ b/src/webtab.h @@ -67,6 +67,9 @@ private slots: void createWalletBar(const QString &, const QUrl &); void showRSSInfo(QPoint pos); +signals: + void loadProgressing(); + private: WebView *_view; diff --git a/src/webview.cpp b/src/webview.cpp index a26cf63f..061dd256 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -496,6 +496,23 @@ void WebView::keyPressEvent(QKeyEvent *event) KWebView::keyPressEvent(event); } +void WebView::wheelEvent(QWheelEvent *event) +{ + // Sync with the zoom slider + if (event->modifiers() == Qt::ControlModifier) + { + emit zoomChanged(zoomFactor()); + } + + KWebView::wheelEvent(event); + + // Limits of the slider + if (zoomFactor() > 1.9) + setZoomFactor(1.9); + else if (zoomFactor() < 0.1) + setZoomFactor(0.1); +} + void WebView::inspect() { diff --git a/src/webview.h b/src/webview.h index bac12e99..a4ba676c 100644 --- a/src/webview.h +++ b/src/webview.h @@ -56,6 +56,7 @@ protected: void mousePressEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event); void keyPressEvent(QKeyEvent *event); + void wheelEvent(QWheelEvent *event); private slots: void search(); @@ -73,6 +74,7 @@ private slots: signals: void loadUrl(const KUrl &, const Rekonq::OpenType &); + void zoomChanged(qreal); private: QPoint _mousePos; |