feat: wheel events

This commit is contained in:
2025-08-06 02:15:16 +02:00
parent b4988f4499
commit a6dfa35fa7
6 changed files with 72 additions and 8 deletions
+10 -1
View File
@@ -1,7 +1,7 @@
/*
* @Author: Uyanide pywang0608@foxmail.com
* @Date: 2025-08-05 00:37:58
* @LastEditTime: 2025-08-06 00:48:11
* @LastEditTime: 2025-08-06 02:13:59
* @Description: MainWindow implementation.
*/
#include "main_window.h"
@@ -70,6 +70,15 @@ void MainWindow::keyPressEvent(QKeyEvent *event) {
}
}
void MainWindow::wheelEvent(QWheelEvent *event) {
if (event->angleDelta().y() > 0) {
m_carousel->focusPrevImage();
} else {
m_carousel->focusNextImage();
}
event->accept();
}
void MainWindow::onConfirm() {
close();
const auto path = m_carousel->getCurrentImagePath();