Fix wrong cursor for selected resizeable clips in song editor (#5996)

Fixes #879.
This commit is contained in:
Craig Raslawski
2022-08-27 23:09:52 -04:00
committed by GitHub
parent 4821606465
commit 17f597695b
2 changed files with 10 additions and 4 deletions

View File

@@ -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;

View File

@@ -504,13 +504,13 @@ void ClipView::updateCursor(QMouseEvent * me)
SampleClip * sClip = dynamic_cast<SampleClip*>(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
} // namespace lmms::gui