Skip to content

Commit

Permalink
Show the names of patterns in their tool tip
Browse files Browse the repository at this point in the history
Adjust PatternView::update to show the name of the pattern as the tool
tip (regardless of whether it is a beat and bassline or a melody
pattern).

Override the public slot TrackContentObjectView::update for
AutomationPatternView and BBTCOView. Implement it similar to
PatternView::update.
  • Loading branch information
michaelgregorius committed Jul 19, 2017
1 parent e05c827 commit 63e64eb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
1 change: 1 addition & 0 deletions include/AutomationPatternView.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class AutomationPatternView : public TrackContentObjectView
public slots:
/// Opens this view's pattern in the global automation editor
void openInAutomationEditor();
virtual void update();


protected slots:
Expand Down
2 changes: 2 additions & 0 deletions include/BBTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ class BBTCOView : public TrackContentObjectView
}
void setColor( QColor _new_color );

public slots:
virtual void update();

protected slots:
void openInBBEditor();
Expand Down
10 changes: 8 additions & 2 deletions src/gui/AutomationPatternView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ AutomationPatternView::AutomationPatternView( AutomationPattern * _pattern,

setAttribute( Qt::WA_OpaquePaintEvent, true );

ToolTip::add( this, tr( "double-click to open this pattern in "
"automation editor" ) );
ToolTip::add(this, m_pat->name());
setStyle( QApplication::style() );

if( s_pat_rec == NULL ) { s_pat_rec = new QPixmap( embed::getIconPixmap(
Expand All @@ -81,6 +80,13 @@ void AutomationPatternView::openInAutomationEditor()
}


void AutomationPatternView::update()
{
ToolTip::add(this, m_pat->name());

TrackContentObjectView::update();
}



void AutomationPatternView::resetName()
Expand Down
7 changes: 7 additions & 0 deletions src/tracks/BBTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "RenameDialog.h"
#include "Song.h"
#include "SongEditor.h"
#include "ToolTip.h"
#include "TrackLabelButton.h"


Expand Down Expand Up @@ -399,6 +400,12 @@ void BBTCOView::setColor( QColor new_color )
}


void BBTCOView::update()
{
ToolTip::add(this, m_bbTCO->name());

TrackContentObjectView::update();
}



Expand Down
11 changes: 1 addition & 10 deletions src/tracks/Pattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,16 +646,7 @@ PatternView::~PatternView()

void PatternView::update()
{
if ( m_pat->m_patternType == Pattern::BeatPattern )
{
ToolTip::add( this,
tr( "use mouse wheel to set velocity of a step" ) );
}
else
{
ToolTip::add( this,
tr( "double-click to open in Piano Roll" ) );
}
ToolTip::add(this, m_pat->name());

TrackContentObjectView::update();
}
Expand Down

0 comments on commit 63e64eb

Please sign in to comment.