mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
Ladybird: Add initial support for Ctrl+Scroll to zoom in/out
This commit adds basic functionality to zoom in/out using the Ctrl+Scroll shortcut.
This commit is contained in:
parent
6b649af447
commit
5775993a2a
2 changed files with 11 additions and 0 deletions
|
@ -662,6 +662,16 @@ void BrowserWindow::moveEvent(QMoveEvent* event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BrowserWindow::wheelEvent(QWheelEvent* event)
|
||||||
|
{
|
||||||
|
if ((event->modifiers() & Qt::ControlModifier) != 0) {
|
||||||
|
if (event->angleDelta().y() > 0)
|
||||||
|
zoom_in();
|
||||||
|
else if (event->angleDelta().y() < 0)
|
||||||
|
zoom_out();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool BrowserWindow::eventFilter(QObject* obj, QEvent* event)
|
bool BrowserWindow::eventFilter(QObject* obj, QEvent* event)
|
||||||
{
|
{
|
||||||
if (event->type() == QEvent::MouseButtonRelease) {
|
if (event->type() == QEvent::MouseButtonRelease) {
|
||||||
|
|
|
@ -92,6 +92,7 @@ protected:
|
||||||
private:
|
private:
|
||||||
virtual void resizeEvent(QResizeEvent*) override;
|
virtual void resizeEvent(QResizeEvent*) override;
|
||||||
virtual void moveEvent(QMoveEvent*) override;
|
virtual void moveEvent(QMoveEvent*) override;
|
||||||
|
virtual void wheelEvent(QWheelEvent*) override;
|
||||||
|
|
||||||
void debug_request(DeprecatedString const& request, DeprecatedString const& argument = "");
|
void debug_request(DeprecatedString const& request, DeprecatedString const& argument = "");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue