diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.cpp index 61c1ce0f..59aaaa14 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.cpp @@ -82,10 +82,31 @@ namespace Bloom::Widgets this->setVisible(visible); } + bool PanelWidget::eventFilter(QObject* object, QEvent* event) { + const auto eventType = event->type(); + + if (event->isSinglePointEvent()) { + auto* pointerEvent = dynamic_cast(event); + + if ( + this->initialResizePoint.has_value() + || this->isPositionWithinHandleArea(pointerEvent->position().toPoint()) + ) { + this->event(event); + return true; + } + } + + return false; + } + bool PanelWidget::event(QEvent* event) { if (event->type() == QEvent::Type::HoverMove) { auto* hoverEvent = dynamic_cast(event); - if (this->initialResizePoint.has_value() || this->isPositionWithinHandleArea(hoverEvent->position().toPoint())) { + if ( + this->initialResizePoint.has_value() + || this->isPositionWithinHandleArea(hoverEvent->position().toPoint()) + ) { this->setCursor(this->resizeCursor); } else { diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.hpp index b98c1afa..9766b7a7 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.hpp @@ -78,6 +78,7 @@ namespace Bloom::Widgets std::optional initialResizePoint = std::nullopt; int initialResizeSize = 0; + bool eventFilter(QObject *object, QEvent *event) override; bool event(QEvent* event) override; void mousePressEvent(QMouseEvent* event) override; void mouseReleaseEvent(QMouseEvent* event) override; diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotManager.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotManager.cpp index f7bb7f5c..99c73cc9 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotManager.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotManager.cpp @@ -56,6 +56,7 @@ namespace Bloom::Widgets auto* containerLayout = this->container->findChild(); this->snapshotListView = new ListView({}, this); + this->snapshotListView->viewport()->installEventFilter(parent); this->snapshotListView->setVerticalScrollBarPolicy(Qt::ScrollBarPolicy::ScrollBarAsNeeded); this->snapshotListScene = this->snapshotListView->listScene(); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp index 396b100d..86d6f117 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp @@ -117,7 +117,7 @@ namespace Bloom::Widgets this->rightPanel = new PanelWidget(PanelWidgetType::RIGHT, this->settings.rightPanelState, this); this->rightPanel->setObjectName("right-panel"); this->rightPanel->setMinimumResize(200); - this->rightPanel->setHandleSize(5); + this->rightPanel->setHandleSize(6); this->subContainerLayout->insertWidget(2, this->rightPanel); this->snapshotManager = new SnapshotManager(