Some shit.
This commit is contained in:
parent
e43a7606c8
commit
36aadcaa1e
|
@ -199,9 +199,6 @@ void WebBrowser::createConnections() {
|
||||||
// Forward title/icon changes.
|
// Forward title/icon changes.
|
||||||
connect(m_webView, SIGNAL(titleChanged(QString)), this, SLOT(onTitleChanged(QString)));
|
connect(m_webView, SIGNAL(titleChanged(QString)), this, SLOT(onTitleChanged(QString)));
|
||||||
connect(m_webView, SIGNAL(iconUrlChanged(QUrl)), this, SLOT(onIconChanged()));
|
connect(m_webView, SIGNAL(iconUrlChanged(QUrl)), this, SLOT(onIconChanged()));
|
||||||
|
|
||||||
// Misc connections.
|
|
||||||
connect(m_webView, SIGNAL(zoomFactorChanged()), this, SLOT(updateZoomGui()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebBrowser::onIconChanged() {
|
void WebBrowser::onIconChanged() {
|
||||||
|
|
|
@ -32,23 +32,6 @@ WebView::~WebView() {
|
||||||
qDebug("Destroying WebView.");
|
qDebug("Destroying WebView.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebView::wheelEvent(QWheelEvent *event) {
|
|
||||||
if (event->modifiers() & Qt::ControlModifier) {
|
|
||||||
if (event->delta() > 0) {
|
|
||||||
increaseWebPageZoom();
|
|
||||||
emit zoomFactorChanged();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if (event->delta() < 0) {
|
|
||||||
decreaseWebPageZoom();
|
|
||||||
emit zoomFactorChanged();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QWebEngineView::wheelEvent(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool WebView::increaseWebPageZoom() {
|
bool WebView::increaseWebPageZoom() {
|
||||||
const qreal new_factor = zoomFactor() + 0.1;
|
const qreal new_factor = zoomFactor() + 0.1;
|
||||||
|
|
||||||
|
|
|
@ -34,20 +34,12 @@ class WebView : public QWebEngineView {
|
||||||
return m_page;
|
return m_page;
|
||||||
}
|
}
|
||||||
|
|
||||||
signals:
|
|
||||||
// Emitted if user changes zoom factor via CTRL + mouse wheel combo.
|
|
||||||
void zoomFactorChanged();
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// Page zoom modifiers.
|
// Page zoom modifiers.
|
||||||
bool increaseWebPageZoom();
|
bool increaseWebPageZoom();
|
||||||
bool decreaseWebPageZoom();
|
bool decreaseWebPageZoom();
|
||||||
bool resetWebPageZoom();
|
bool resetWebPageZoom();
|
||||||
|
|
||||||
protected:
|
|
||||||
// Customize mouse wheeling.
|
|
||||||
void wheelEvent(QWheelEvent *event);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QWebEnginePage *m_page;
|
QWebEnginePage *m_page;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue