summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp3
-rw-r--r--src/webview.cpp2
-rw-r--r--src/webview.h2
-rw-r--r--src/zoombar.cpp10
4 files changed, 10 insertions, 7 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 01dd2ad2..4d6883ef 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -255,6 +255,7 @@ void MainWindow::postLaunch()
// Zoom Bar signal
connect(m_view, SIGNAL(currentChanged(int)), m_zoomBar, SLOT(updateSlider(int)));
+ connect(this->currentTab()->view(), SIGNAL(zoomChanged(int)), m_zoomBar, SLOT(setValue(int))); // Ctrl + wheel handling
// setting up toolbars to NOT have context menu enabled
setContextMenuPolicy(Qt::DefaultContextMenu);
@@ -1334,4 +1335,4 @@ bool MainWindow::queryClose()
}
}
return true;
-} \ No newline at end of file
+}
diff --git a/src/webview.cpp b/src/webview.cpp
index 188216f8..a1b39805 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -543,7 +543,7 @@ void WebView::wheelEvent(QWheelEvent *event)
if ((zoomFactor() * 10 - newFactor) > 0.5)
newFactor++;
- emit zoomChanged((qreal)newFactor / 10);
+ emit zoomChanged(newFactor);
}
}
diff --git a/src/webview.h b/src/webview.h
index a4ba676c..1fd40f92 100644
--- a/src/webview.h
+++ b/src/webview.h
@@ -74,7 +74,7 @@ private slots:
signals:
void loadUrl(const KUrl &, const Rekonq::OpenType &);
- void zoomChanged(qreal);
+ void zoomChanged(int);
private:
QPoint _mousePos;
diff --git a/src/zoombar.cpp b/src/zoombar.cpp
index d44553ed..1b52ae7b 100644
--- a/src/zoombar.cpp
+++ b/src/zoombar.cpp
@@ -64,7 +64,7 @@ ZoomBar::ZoomBar(QWidget *parent)
layout->setAlignment(hideButton, Qt::AlignLeft | Qt::AlignTop);
// label
- QLabel *label = new QLabel(i18n("Zoom:"));
+ QLabel *label = new QLabel(i18n("Zoom :"));
layout->addWidget(label);
m_zoomSlider->setTracking(true);
@@ -77,13 +77,15 @@ ZoomBar::ZoomBar(QWidget *parent)
m_zoomOut->setAutoRaise(true);
m_zoomNormal->setAutoRaise(true);
- layout->setSpacing(0);
- layout->setMargin(0);
+ // layout->setSpacing(0);
+ // layout->setMargin(0);
layout->addWidget(m_zoomOut);
layout->addWidget(m_zoomSlider);
layout->addWidget(m_zoomIn);
layout->addWidget(m_zoomNormal);
+ layout->addStretch();
+
setLayout(layout);
// we start off hidden
@@ -161,5 +163,5 @@ void ZoomBar::updateSlider(int webview)
void ZoomBar::setValue(int value)
{
m_zoomSlider->setValue(value);
- Application::instance()->mainWindow()->currentTab()->view()->setZoomFactor(QVariant(value).toReal() / 10);
+ Application::instance()->mainWindow()->currentTab()->view()->setZoomFactor(QVariant(m_zoomSlider->value()).toReal() / 10); // Don't allox max +1 values
}