Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions data/themes/default/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,8 @@ TrackContentObjectView {
qproperty-textColor: #fff;
qproperty-textShadowColor: rgba(0,0,0,200);
qproperty-gradient: false; /* boolean property, set true to have a gradient */
qproperty-mouseHotspotX: 16;
qproperty-mouseHotspotY: 16;
}

/* instrument pattern */
Expand Down
12 changes: 11 additions & 1 deletion include/Track.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ class TrackContentObjectView : public selectableObject, public ModelView
Q_PROPERTY( QColor textShadowColor READ textShadowColor WRITE setTextShadowColor )
Q_PROPERTY( QColor BBPatternBackground READ BBPatternBackground WRITE setBBPatternBackground )
Q_PROPERTY( bool gradient READ gradient WRITE setGradient )
Q_PROPERTY( int mouseHotspotX READ getMouseHotspotX WRITE setMouseHotspotX )
Q_PROPERTY( int mouseHotspotY READ getMouseHotspotY WRITE setMouseHotspotY )

public:
TrackContentObjectView( TrackContentObject * tco, TrackView * tv );
Expand All @@ -226,13 +228,18 @@ class TrackContentObjectView : public selectableObject, public ModelView
QColor textShadowColor() const;
QColor BBPatternBackground() const;
bool gradient() const;
int getMouseHotspotX() const { return m_mouseHotspotX; }
int getMouseHotspotY() const { return m_mouseHotspotY; }
void setMutedColor( const QColor & c );
void setMutedBackgroundColor( const QColor & c );
void setSelectedColor( const QColor & c );
void setTextColor( const QColor & c );
void setTextShadowColor( const QColor & c );
void setBBPatternBackground( const QColor & c );
void setGradient( const bool & b );
void setMouseHotspotX(int x) { m_mouseHotspotX = x; }
void setMouseHotspotY(int y) { m_mouseHotspotY = y; }


// access needsUpdate member variable
bool needsUpdate();
Expand Down Expand Up @@ -302,8 +309,11 @@ protected slots:
QColor m_textShadowColor;
QColor m_BBPatternBackground;
bool m_gradient;
int m_mouseHotspotX;
int m_mouseHotspotY;
bool m_cursorSetYet = false;

bool m_needsUpdate;
bool m_needsUpdate;
inline void setInitialMousePos( QPoint pos )
{
m_initialMousePos = pos;
Expand Down
12 changes: 10 additions & 2 deletions src/core/Track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ TrackContentObjectView::TrackContentObjectView( TrackContentObject * tco,
m_textShadowColor( 0, 0, 0 ),
m_BBPatternBackground( 0, 0, 0 ),
m_gradient( true ),
m_mouseHotspotX(0),
m_mouseHotspotY(0),
m_needsUpdate( true )
{
if( s_textFloat == NULL )
Expand All @@ -268,7 +270,7 @@ TrackContentObjectView::TrackContentObjectView( TrackContentObject * tco,
setAttribute( Qt::WA_OpaquePaintEvent, true );
setAttribute( Qt::WA_DeleteOnClose, true );
setFocusPolicy( Qt::StrongFocus );
setCursor( QCursor( embed::getIconPixmap( "hand" ), 3, 3 ) );
setCursor( QCursor( embed::getIconPixmap( "hand" ), m_mouseHotspotX, m_mouseHotspotY ) );
move( 0, 0 );
show();

Expand Down Expand Up @@ -317,6 +319,12 @@ TrackContentObjectView::~TrackContentObjectView()
*/
void TrackContentObjectView::update()
{
if( !m_cursorSetYet )
{
setCursor( QCursor( embed::getIconPixmap( "hand" ), m_mouseHotspotX, m_mouseHotspotY ) );
m_cursorSetYet = true;
}

if( fixedTCOs() )
{
updateLength();
Expand Down Expand Up @@ -572,7 +580,7 @@ void TrackContentObjectView::leaveEvent( QEvent * e )
{
if( cursor().shape() != Qt::BitmapCursor )
{
setCursor( QCursor( embed::getIconPixmap( "hand" ), 3, 3 ) );
setCursor( QCursor( embed::getIconPixmap( "hand" ), m_mouseHotspotX, m_mouseHotspotY ) );
}
if( e != NULL )
{
Expand Down