mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-10-26 14:57:54 +03: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
Notes:
sideshowbarker
2024-07-17 01:53:23 +09:00
Author: https://github.com/hikilaka Commit: https://github.com/SerenityOS/serenity/commit/5775993a2a Pull-request: https://github.com/SerenityOS/serenity/pull/19722
@ -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)
|
||||
{
|
||||
if (event->type() == QEvent::MouseButtonRelease) {
|
||||
|
@ -92,6 +92,7 @@ protected:
|
||||
private:
|
||||
virtual void resizeEvent(QResizeEvent*) override;
|
||||
virtual void moveEvent(QMoveEvent*) override;
|
||||
virtual void wheelEvent(QWheelEvent*) override;
|
||||
|
||||
void debug_request(DeprecatedString const& request, DeprecatedString const& argument = "");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user