From 17f597695bddb5db7933815e685026a4d9fc84ab Mon Sep 17 00:00:00 2001 From: Craig Raslawski Date: Sat, 27 Aug 2022 23:09:52 -0400 Subject: [PATCH] Fix wrong cursor for selected resizeable clips in song editor (#5996) Fixes #879. --- include/Clip.h | 6 ++++++ src/gui/clips/ClipView.cpp | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/Clip.h b/include/Clip.h index 14595263e..204a071a7 100644 --- a/include/Clip.h +++ b/include/Clip.h @@ -93,6 +93,12 @@ public: return m_length; } + /*! \brief Specify whether or not a TCO automatically resizes. + * + * If a TCO does automatically resize, it cannot be manually + * resized by clicking and dragging its edge. + * + */ inline void setAutoResize( const bool r ) { m_autoResize = r; diff --git a/src/gui/clips/ClipView.cpp b/src/gui/clips/ClipView.cpp index 0f362c58d..e41431314 100644 --- a/src/gui/clips/ClipView.cpp +++ b/src/gui/clips/ClipView.cpp @@ -504,13 +504,13 @@ void ClipView::updateCursor(QMouseEvent * me) SampleClip * sClip = dynamic_cast(m_clip); // If we are at the edges, use the resize cursor - if ((me->x() > width() - RESIZE_GRIP_WIDTH && !me->buttons() && !m_clip->getAutoResize()) - || (me->x() < RESIZE_GRIP_WIDTH && !me->buttons() && sClip && !m_clip->getAutoResize())) + if (!me->buttons() && !m_clip->getAutoResize() && !isSelected() + && ((me->x() > width() - RESIZE_GRIP_WIDTH) || (me->x() < RESIZE_GRIP_WIDTH && sClip))) { setCursor(Qt::SizeHorCursor); } // If we are in the middle on knife mode, use the knife cursor - else if (sClip && m_trackView->trackContainerView()->knifeMode()) + else if (sClip && m_trackView->trackContainerView()->knifeMode() && !isSelected()) { setCursor(m_cursorKnife); } @@ -1507,4 +1507,4 @@ QColor ClipView::getColorForDisplay( QColor defaultColor ) } -} // namespace lmms::gui \ No newline at end of file +} // namespace lmms::gui