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
+4 -1
View File
@@ -1,7 +1,7 @@
/*
* @Author: Uyanide pywang0608@foxmail.com
* @Date: 2025-08-05 01:22:53
* @LastEditTime: 2025-08-06 01:27:49
* @LastEditTime: 2025-08-06 02:12:46
* @Description: Animated carousel widget for displaying and selecting images.
*/
#include "images_carousel.h"
@@ -39,6 +39,7 @@ ImagesCarousel::ImagesCarousel(const double itemAspectRatio,
m_sortType(sortType),
m_sortReverse(sortReverse) {
ui->setupUi(this);
m_scrollArea = dynamic_cast<ImagesCarouselScrollArea*>(ui->scrollArea);
m_imagesLayout = dynamic_cast<QHBoxLayout*>(ui->scrollAreaWidgetContents->layout());
@@ -245,8 +246,10 @@ void ImagesCarousel::_focusCurrImage() {
this,
[this]() {
m_suppressAutoFocus = false;
m_scrollArea->setBlockInput(false);
});
m_suppressAutoFocus = true;
m_scrollArea->setBlockInput(true);
m_scrollAnimation->start();
}