Use system cursors instead of embedded raster images where possible (#7838)

Given these changes, the knife tool now uses `Qt::SplitHCursor`, but `Qt::IBeamCursor` is also a a viable option. I am noting this should substantial concern arise over the appearance of `Qt::SplitHCursor` due to cursor themes, such as the default one applied to applications running under WSL.
This commit is contained in:
Fawn
2025-10-28 12:14:46 -07:00
committed by GitHub
parent b1e6d180c7
commit 6cec90cabb
16 changed files with 15 additions and 52 deletions

View File

@@ -49,7 +49,7 @@ AutomatableModelView::AutomatableModelView( Model* model, QWidget* _this ) :
m_conversionFactor( 1.0 )
{
widget()->setAcceptDrops( true );
widget()->setCursor( QCursor( embed::getIconPixmap( "hand" ), 3, 3 ) );
widget()->setCursor(Qt::PointingHandCursor);
}
void AutomatableModelView::addDefaultActions( QMenu* menu )

View File

@@ -96,11 +96,6 @@ ClipView::ClipView( Clip * clip,
m_patternClipBackground( 0, 0, 0 ),
m_gradient( true ),
m_markerColor(0, 0, 0),
m_mouseHotspotHand( 0, 0 ),
m_mouseHotspotKnife( 0, 0 ),
m_cursorHand( QCursor( embed::getIconPixmap( "hand" ) ) ),
m_cursorKnife( QCursor( embed::getIconPixmap( "cursor_knife" ) ) ),
m_cursorSetYet( false ),
m_needsUpdate( true )
{
if( s_textFloat == nullptr )
@@ -111,7 +106,7 @@ ClipView::ClipView( Clip * clip,
setAttribute( Qt::WA_DeleteOnClose, true );
setFocusPolicy( Qt::StrongFocus );
setCursor( m_cursorHand );
setCursor(Qt::PointingHandCursor);
move( 0, 0 );
show();
@@ -167,14 +162,6 @@ ClipView::~ClipView()
*/
void ClipView::update()
{
if( !m_cursorSetYet )
{
m_cursorHand = QCursor( embed::getIconPixmap( "hand" ), m_mouseHotspotHand.width(), m_mouseHotspotHand.height() );
m_cursorKnife = QCursor( embed::getIconPixmap( "cursor_knife" ), m_mouseHotspotKnife.width(), m_mouseHotspotKnife.height() );
setCursor( m_cursorHand );
m_cursorSetYet = true;
}
if( fixedClips() )
{
updateLength();
@@ -504,10 +491,10 @@ void ClipView::updateCursor(QMouseEvent * me)
// If we are in the middle on knife mode, use the knife cursor
else if (m_trackView->trackContainerView()->knifeMode() && !isSelected())
{
setCursor(m_cursorKnife);
setCursor(Qt::SplitHCursor);
}
// If we are in the middle in any other mode, use the hand cursor
else { setCursor(m_cursorHand); }
else { setCursor(Qt::PointingHandCursor); }
}
@@ -681,7 +668,7 @@ void ClipView::mousePressEvent( QMouseEvent * me )
else if (knifeMode)
{
m_action = Action::Split;
setCursor( m_cursorKnife );
setCursor(Qt::SplitHCursor);
setMarkerPos( knifeMarkerPos( me ) );
setMarkerEnabled( true );
update();
@@ -996,7 +983,7 @@ void ClipView::mouseMoveEvent( QMouseEvent * me )
}
else if( m_action == Action::Split )
{
setCursor(m_cursorKnife);
setCursor(Qt::SplitHCursor);
setMarkerPos(knifeMarkerPos(me));
update();
}

View File

@@ -47,7 +47,7 @@ FadeButton::FadeButton(const QColor & _normal_color,
m_activatedColor( _activated_color ),
m_holdColor( holdColor )
{
setCursor(QCursor(embed::getIconPixmap("hand"), 3, 3));
setCursor(Qt::PointingHandCursor);
setFocusPolicy(Qt::NoFocus);
activeNotes = 0;
}

View File

@@ -47,7 +47,7 @@ TrackLabelButton::TrackLabelButton( TrackView * _tv, QWidget * _parent ) :
{
setAcceptDrops( true );
setFocusPolicy(Qt::NoFocus);
setCursor( QCursor( embed::getIconPixmap( "hand" ), 3, 3 ) );
setCursor(Qt::PointingHandCursor);
setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
m_renameLineEdit = new TrackRenameLineEdit( this );

View File

@@ -90,6 +90,7 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * parent ) :
m_trackOps->setFocusPolicy( Qt::NoFocus );
m_trackOps->setMenu( toMenu );
m_trackOps->setToolTip(tr("Actions"));
m_trackOps->setCursor(Qt::PointingHandCursor);
m_muteBtn = new AutomatableButton(operationsWidget, tr("Mute"));
m_muteBtn->setCheckable(true);