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