From 52a998ca5cb95333e0e7ba3ba3b01c544b636ed1 Mon Sep 17 00:00:00 2001 From: Edu Meneses Date: Sat, 14 Mar 2026 21:25:34 -0400 Subject: [PATCH 1/4] UI: Increase hitboxes and interaction areas for core elements Increased hitboxes and interaction areas for various UI components to improve selection and drag-and-drop usability: - Cables: Increased stroke width from 7 to 14. - Intervals: Added a 5-pixel margin and increased drop threshold to 12. - Conditions: Increased stroke width from 1 to 10. - Events: Widened bounding box from 6 to 12. - States: Enlarged visual radii (full: 6->8, point: 3.5->5). - Ports: Expanded interaction area to 20x20. - Slot Headers: Widened drag area and increased drop threshold between slots. --- .../Process/Dataflow/CableItem.cpp | 2 +- .../Process/Dataflow/PortItem.cpp | 4 +-- .../Scenario/Document/Event/ConditionView.cpp | 2 +- .../Scenario/Document/Event/EventView.hpp | 2 +- .../Document/Interval/IntervalView.cpp | 12 +++---- .../Scenario/Document/Interval/SlotHeader.cpp | 36 +++++++++---------- .../Scenario/Document/State/StateView.hpp | 4 +-- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/plugins/score-lib-process/Process/Dataflow/CableItem.cpp b/src/plugins/score-lib-process/Process/Dataflow/CableItem.cpp index 7309842511..abd84b9058 100644 --- a/src/plugins/score-lib-process/Process/Dataflow/CableItem.cpp +++ b/src/plugins/score-lib-process/Process/Dataflow/CableItem.cpp @@ -113,7 +113,7 @@ static const QPainterPathStroker& cableStroker() QPen pen; pen.setCapStyle(Qt::PenCapStyle::RoundCap); pen.setJoinStyle(Qt::PenJoinStyle::RoundJoin); - pen.setWidthF(7.); + pen.setWidthF(14.); return pen; }()}; return cable_stroker; diff --git a/src/plugins/score-lib-process/Process/Dataflow/PortItem.cpp b/src/plugins/score-lib-process/Process/Dataflow/PortItem.cpp index 84bc85de09..af9e03b714 100644 --- a/src/plugins/score-lib-process/Process/Dataflow/PortItem.cpp +++ b/src/plugins/score-lib-process/Process/Dataflow/PortItem.cpp @@ -568,8 +568,8 @@ void PortItem::setHighlight(bool b) QRectF PortItem::boundingRect() const { - constexpr auto max_diam = 13.; - return {0., 0., max_diam, max_diam}; + constexpr auto max_diam = 20.; + return {-3.5, -3.5, max_diam, max_diam}; } void PortItem::paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) diff --git a/src/plugins/score-plugin-scenario/Scenario/Document/Event/ConditionView.cpp b/src/plugins/score-plugin-scenario/Scenario/Document/Event/ConditionView.cpp index bdf79adbb6..a2dc5c7515 100644 --- a/src/plugins/score-plugin-scenario/Scenario/Document/Event/ConditionView.cpp +++ b/src/plugins/score-plugin-scenario/Scenario/Document/Event/ConditionView.cpp @@ -114,7 +114,7 @@ void ConditionView::setHeight(qreal newH) m_Cpath.arcTo(bottomRect, -180., 120.); QPainterPathStroker stk; - stk.setWidth(1.); + stk.setWidth(10.); m_strokedCpath = stk.createStroke(m_Cpath); this->update(); diff --git a/src/plugins/score-plugin-scenario/Scenario/Document/Event/EventView.hpp b/src/plugins/score-plugin-scenario/Scenario/Document/Event/EventView.hpp index c895d3b6d3..3de10a286a 100644 --- a/src/plugins/score-plugin-scenario/Scenario/Document/Event/EventView.hpp +++ b/src/plugins/score-plugin-scenario/Scenario/Document/Event/EventView.hpp @@ -45,7 +45,7 @@ class SCORE_PLUGIN_SCENARIO_EXPORT EventView final const EventPresenter& presenter() const { return m_presenter; } - QRectF boundingRect() const override { return {-1, 0., 6, m_height}; } + QRectF boundingRect() const override { return {-4, 0., 12, m_height}; } void setStatus(ExecutionStatus); void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) diff --git a/src/plugins/score-plugin-scenario/Scenario/Document/Interval/IntervalView.cpp b/src/plugins/score-plugin-scenario/Scenario/Document/Interval/IntervalView.cpp index 2e09ab87c9..3c7302388d 100644 --- a/src/plugins/score-plugin-scenario/Scenario/Document/Interval/IntervalView.cpp +++ b/src/plugins/score-plugin-scenario/Scenario/Document/Interval/IntervalView.cpp @@ -329,7 +329,7 @@ void IntervalView::dragEnterEvent(QGraphicsSceneDragDropEvent* event) void IntervalView::dragMoveEvent(QGraphicsSceneDragDropEvent* event) { - setDropTarget((event->pos().x() <= this->m_defaultWidth && event->pos().y() <= 7.)); + setDropTarget((event->pos().x() <= this->m_defaultWidth && event->pos().y() <= 12.)); event->accept(); } @@ -343,7 +343,7 @@ void IntervalView::dragLeaveEvent(QGraphicsSceneDragDropEvent* event) void IntervalView::dropEvent(QGraphicsSceneDragDropEvent* event) { setDropTarget(false); - if(event->pos().x() <= this->m_defaultWidth && event->pos().y() <= 7.) + if(event->pos().x() <= this->m_defaultWidth && event->pos().y() <= 12.) { dropReceived(event->pos(), *event->mimeData()); update(); @@ -361,9 +361,9 @@ QPainterPath Scenario::IntervalView::shape() const { qreal x = std::min(0., minWidth()); QPainterPath p; - p.addRect({x, -1., defaultWidth() - x, intervalAndRackHeight()}); + p.addRect({x, -5., defaultWidth() - x, intervalAndRackHeight() + 10.}); if(!infinite()) - p.addRect({x, -1., maxWidth() - x, 5}); + p.addRect({x, -5., maxWidth() - x, 10.}); return p; } @@ -376,9 +376,9 @@ QPainterPath Scenario::IntervalView::opaqueArea() const bool Scenario::IntervalView::contains(const QPointF& pt) const { qreal x = std::min(0., minWidth()); - if(!QRectF{x, -1., defaultWidth() - x, intervalAndRackHeight()}.contains(pt)) + if(!QRectF{x, -5., defaultWidth() - x, intervalAndRackHeight() + 10.}.contains(pt)) if(!infinite()) - if(!QRectF{x, -1., maxWidth() - x, 5}.contains(pt)) + if(!QRectF{x, -5., maxWidth() - x, 10.}.contains(pt)) return false; return true; } diff --git a/src/plugins/score-plugin-scenario/Scenario/Document/Interval/SlotHeader.cpp b/src/plugins/score-plugin-scenario/Scenario/Document/Interval/SlotHeader.cpp index 51f72c4f7a..80ff5b4fdf 100644 --- a/src/plugins/score-plugin-scenario/Scenario/Document/Interval/SlotHeader.cpp +++ b/src/plugins/score-plugin-scenario/Scenario/Document/Interval/SlotHeader.cpp @@ -100,7 +100,7 @@ void SlotHeader::mousePressEvent(QGraphicsSceneMouseEvent* event) m_presenter.selectedSlot(m_slotIndex); const auto xpos = event->pos().x(); - if(xpos >= 0 && xpos < 16) + if(xpos >= 0 && xpos < 30) { slot_header_drag.reset(new QDrag(event->widget())); } @@ -159,7 +159,7 @@ void SlotHeader::mouseMoveEvent(QGraphicsSceneMouseEvent* event) event->accept(); const auto xpos = event->buttonDownPos(Qt::LeftButton).x(); - if(xpos >= 0 && xpos < 16 && slot_header_drag) + if(xpos >= 0 && xpos < 30 && slot_header_drag) { auto min_dist = (event->screenPos() - event->buttonDownScreenPos(Qt::LeftButton)) .manhattanLength() @@ -210,7 +210,7 @@ void SlotHeader::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) void SlotHeader::hoverEnterEvent(QGraphicsSceneHoverEvent* event) { const auto xpos = event->pos().x(); - if(xpos >= 0 && xpos < 16) + if(xpos >= 0 && xpos < 30) { if(this->cursor().shape() != Qt::CrossCursor) setCursor(Qt::CrossCursor); @@ -225,7 +225,7 @@ void SlotHeader::hoverEnterEvent(QGraphicsSceneHoverEvent* event) void SlotHeader::hoverMoveEvent(QGraphicsSceneHoverEvent* event) { const auto xpos = event->pos().x(); - if(xpos >= 0 && xpos < 16) + if(xpos >= 0 && xpos < 30) { if(this->cursor().shape() != Qt::CrossCursor) setCursor(Qt::CrossCursor); @@ -387,12 +387,12 @@ void SlotDragOverlay::onDrag(QPointF pos) if(y <= height) { - m_drawnRect = {0, height - 2.5, rect.width(), 5}; + m_drawnRect = {0, height - 6.0, rect.width(), 12.0}; update(); } else if(y > rect.height() - 5.) { - m_drawnRect = {0, rect.height() - 5., rect.width(), 5}; + m_drawnRect = {0, rect.height() - 6.0, rect.width(), 12.0}; update(); } else @@ -403,13 +403,13 @@ void SlotDragOverlay::onDrag(QPointF pos) { const auto next_height = itv.getSlotHeight({i, view}) + SlotHeader::headerHeight() + SlotFooter::footerHeight(); - if(y > height - 2.5 && y < height + 2.5) + if(y > height - 6.0 && y < height + 6.0) { - m_drawnRect = {0, height - 2.5, rect.width(), 5}; + m_drawnRect = {0, height - 6.0, rect.width(), 12.0}; update(); break; } - else if(y < height + next_height - 2.5) + else if(y < height + next_height - 6.0) { m_drawnRect = {0, height, rect.width(), next_height}; update(); @@ -419,9 +419,9 @@ void SlotDragOverlay::onDrag(QPointF pos) height += next_height; } - if(y > height - 2.5 && y < height + 2.5) + if(y > height - 6.0 && y < height + 6.0) { - m_drawnRect = {0, height - 2.5, rect.width(), 5}; + m_drawnRect = {0, height - 6.0, rect.width(), 12.0}; update(); } } @@ -461,13 +461,13 @@ void SlotDragOverlay::dropEvent(QGraphicsSceneDragDropEvent* event) if(y <= height) { - m_drawnRect = {0, height - 2.5, rect.width(), 5}; + m_drawnRect = {0, height - 6.0, rect.width(), 12.0}; dropBefore(0); update(); } else if(y > rect.height() - 5.) { - m_drawnRect = {0, rect.height() - 5., rect.width(), 5}; + m_drawnRect = {0, rect.height() - 6.0, rect.width(), 12.0}; dropBefore(N); update(); } @@ -477,14 +477,14 @@ void SlotDragOverlay::dropEvent(QGraphicsSceneDragDropEvent* event) { const auto next_height = itv.getSlotHeight({i, view}) + SlotHeader::headerHeight() + SlotFooter::footerHeight(); - if(y > height - 2.5 && y < height + 2.5) + if(y > height - 6.0 && y < height + 6.0) { - m_drawnRect = {0, height - 2.5, rect.width(), 5}; + m_drawnRect = {0, height - 6.0, rect.width(), 12.0}; dropBefore(i); update(); return; } - else if(y < height + next_height - 2.5) + else if(y < height + next_height - 6.0) { m_drawnRect = {0, height, rect.width(), next_height}; dropIn(i); @@ -495,9 +495,9 @@ void SlotDragOverlay::dropEvent(QGraphicsSceneDragDropEvent* event) height += next_height; } - if(y > height - 2.5 && y < height + 2.5) + if(y > height - 6.0 && y < height + 6.0) { - m_drawnRect = {0, height - 2.5, rect.width(), 5}; + m_drawnRect = {0, height - 6.0, rect.width(), 12.0}; dropBefore(N); update(); return; diff --git a/src/plugins/score-plugin-scenario/Scenario/Document/State/StateView.hpp b/src/plugins/score-plugin-scenario/Scenario/Document/State/StateView.hpp index 817586c1dd..1968262e1e 100644 --- a/src/plugins/score-plugin-scenario/Scenario/Document/State/StateView.hpp +++ b/src/plugins/score-plugin-scenario/Scenario/Document/State/StateView.hpp @@ -30,8 +30,8 @@ class SCORE_PLUGIN_SCENARIO_EXPORT StateView final W_OBJECT(StateView) Q_INTERFACES(QGraphicsItem) public: - static const constexpr qreal fullRadius = 6.; - static const constexpr qreal pointRadius = 3.5; + static const constexpr qreal fullRadius = 8.; + static const constexpr qreal pointRadius = 5.; static const constexpr qreal notDilated = 1.; static const constexpr qreal dilated = 1.5; From 04e52c65d2f82e4f95e6b09f2f42098bd639c73a Mon Sep 17 00:00:00 2001 From: Edu Meneses Date: Wed, 20 May 2026 17:18:24 -0400 Subject: [PATCH 2/4] added virtual methods for QGraphicsItem --- .../Scenario/Document/State/StateView.cpp | 32 +++++++++++++++++++ .../Scenario/Document/State/StateView.hpp | 4 +++ 2 files changed, 36 insertions(+) diff --git a/src/plugins/score-plugin-scenario/Scenario/Document/State/StateView.cpp b/src/plugins/score-plugin-scenario/Scenario/Document/State/StateView.cpp index 51f7037b73..c9e4a5ad98 100644 --- a/src/plugins/score-plugin-scenario/Scenario/Document/State/StateView.cpp +++ b/src/plugins/score-plugin-scenario/Scenario/Document/State/StateView.cpp @@ -109,6 +109,38 @@ QRectF StateView::boundingRect() const return {-radius, -radius, 2. * radius, 2. * radius}; } +QPainterPath StateView::shape() const +{ + QPainterPath p; + if(m_dilated) + { + p = smallDilated; + if(m_containMessage) + p |= fullDilated; + if(m_containProcess) + p |= fullProcessDilated; + } + else + { + p = smallNonDilated; + if(m_containMessage) + p |= fullNonDilated; + if(m_containProcess) + p |= fullProcessNonDilated; + } + return p; +} + +QPainterPath StateView::opaqueArea() const +{ + return shape(); +} + +bool StateView::contains(const QPointF& point) const +{ + return shape().contains(point); +} + void StateView::paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) { diff --git a/src/plugins/score-plugin-scenario/Scenario/Document/State/StateView.hpp b/src/plugins/score-plugin-scenario/Scenario/Document/State/StateView.hpp index 1968262e1e..c136368f1d 100644 --- a/src/plugins/score-plugin-scenario/Scenario/Document/State/StateView.hpp +++ b/src/plugins/score-plugin-scenario/Scenario/Document/State/StateView.hpp @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -44,6 +45,9 @@ class SCORE_PLUGIN_SCENARIO_EXPORT StateView final StatePresenter& presenter() const { return m_presenter; } QRectF boundingRect() const override; + QPainterPath shape() const override; + QPainterPath opaqueArea() const override; + bool contains(const QPointF& point) const override; void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override; From e29451ae4c122177aae69e46828c47073af80656 Mon Sep 17 00:00:00 2001 From: Edu Meneses Date: Wed, 20 May 2026 17:19:00 -0400 Subject: [PATCH 3/4] added virtual methods for QGraphicsItem --- 3rdparty/avendish | 2 +- 3rdparty/libossia | 2 +- 3rdparty/llfio | 2 +- 3rdparty/opengametools | 1 + 3rdparty/outcome | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) create mode 160000 3rdparty/opengametools diff --git a/3rdparty/avendish b/3rdparty/avendish index ca6263e625..4dd978410f 160000 --- a/3rdparty/avendish +++ b/3rdparty/avendish @@ -1 +1 @@ -Subproject commit ca6263e62559433a0cea96f488e006a2a6edd23b +Subproject commit 4dd978410f81b3d88b1ffaffd8a9f07f489a9cf6 diff --git a/3rdparty/libossia b/3rdparty/libossia index 565267863a..2c41454fbc 160000 --- a/3rdparty/libossia +++ b/3rdparty/libossia @@ -1 +1 @@ -Subproject commit 565267863a6807e08f2084f78fba4736164b8dcc +Subproject commit 2c41454fbcafc16cb6533b48980ea25c8b307c0e diff --git a/3rdparty/llfio b/3rdparty/llfio index 198be38faa..059630a287 160000 --- a/3rdparty/llfio +++ b/3rdparty/llfio @@ -1 +1 @@ -Subproject commit 198be38faa0b05c09b8d75a95fbbc6e81dcb4e49 +Subproject commit 059630a28754145dbd35a83391eabd4473186cf4 diff --git a/3rdparty/opengametools b/3rdparty/opengametools new file mode 160000 index 0000000000..dcabf82345 --- /dev/null +++ b/3rdparty/opengametools @@ -0,0 +1 @@ +Subproject commit dcabf82345979a2d937a5ea29a0b14683a3aa838 diff --git a/3rdparty/outcome b/3rdparty/outcome index 744da6b753..2db94be7aa 160000 --- a/3rdparty/outcome +++ b/3rdparty/outcome @@ -1 +1 @@ -Subproject commit 744da6b7536f2850df972ab01504e3c4d9530149 +Subproject commit 2db94be7aa1c65115d1942042238317d53ab601c From 812d7c6f596ac494c0a20479d4ea17a1de3c9ae2 Mon Sep 17 00:00:00 2001 From: Edu Meneses Date: Thu, 21 May 2026 11:35:43 -0400 Subject: [PATCH 4/4] revert accidental submodule bumps to origin/master versions Co-Authored-By: Claude Sonnet 4.6 --- 3rdparty/avendish | 2 +- 3rdparty/libossia | 2 +- 3rdparty/llfio | 2 +- 3rdparty/outcome | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/3rdparty/avendish b/3rdparty/avendish index 4dd978410f..ca6263e625 160000 --- a/3rdparty/avendish +++ b/3rdparty/avendish @@ -1 +1 @@ -Subproject commit 4dd978410f81b3d88b1ffaffd8a9f07f489a9cf6 +Subproject commit ca6263e62559433a0cea96f488e006a2a6edd23b diff --git a/3rdparty/libossia b/3rdparty/libossia index 2c41454fbc..565267863a 160000 --- a/3rdparty/libossia +++ b/3rdparty/libossia @@ -1 +1 @@ -Subproject commit 2c41454fbcafc16cb6533b48980ea25c8b307c0e +Subproject commit 565267863a6807e08f2084f78fba4736164b8dcc diff --git a/3rdparty/llfio b/3rdparty/llfio index 059630a287..198be38faa 160000 --- a/3rdparty/llfio +++ b/3rdparty/llfio @@ -1 +1 @@ -Subproject commit 059630a28754145dbd35a83391eabd4473186cf4 +Subproject commit 198be38faa0b05c09b8d75a95fbbc6e81dcb4e49 diff --git a/3rdparty/outcome b/3rdparty/outcome index 2db94be7aa..744da6b753 160000 --- a/3rdparty/outcome +++ b/3rdparty/outcome @@ -1 +1 @@ -Subproject commit 2db94be7aa1c65115d1942042238317d53ab601c +Subproject commit 744da6b7536f2850df972ab01504e3c4d9530149