From 63e64eb0fe1a8f8de2aa5a04a0a07a6ad2c1291d Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Wed, 19 Jul 2017 20:34:58 +0200 Subject: [PATCH] Show the names of patterns in their tool tip 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. --- include/AutomationPatternView.h | 1 + include/BBTrack.h | 2 ++ src/gui/AutomationPatternView.cpp | 10 ++++++++-- src/tracks/BBTrack.cpp | 7 +++++++ src/tracks/Pattern.cpp | 11 +---------- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/include/AutomationPatternView.h b/include/AutomationPatternView.h index a13b3a500c8..45aa9ef2a52 100644 --- a/include/AutomationPatternView.h +++ b/include/AutomationPatternView.h @@ -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: diff --git a/include/BBTrack.h b/include/BBTrack.h index 7bb92a90f89..aafeeaf71ad 100644 --- a/include/BBTrack.h +++ b/include/BBTrack.h @@ -98,6 +98,8 @@ class BBTCOView : public TrackContentObjectView } void setColor( QColor _new_color ); +public slots: + virtual void update(); protected slots: void openInBBEditor(); diff --git a/src/gui/AutomationPatternView.cpp b/src/gui/AutomationPatternView.cpp index 465ac69e347..e375373c20a 100644 --- a/src/gui/AutomationPatternView.cpp +++ b/src/gui/AutomationPatternView.cpp @@ -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( @@ -81,6 +80,13 @@ void AutomationPatternView::openInAutomationEditor() } +void AutomationPatternView::update() +{ + ToolTip::add(this, m_pat->name()); + + TrackContentObjectView::update(); +} + void AutomationPatternView::resetName() diff --git a/src/tracks/BBTrack.cpp b/src/tracks/BBTrack.cpp index b1f46a92d45..219226ac43d 100644 --- a/src/tracks/BBTrack.cpp +++ b/src/tracks/BBTrack.cpp @@ -38,6 +38,7 @@ #include "RenameDialog.h" #include "Song.h" #include "SongEditor.h" +#include "ToolTip.h" #include "TrackLabelButton.h" @@ -399,6 +400,12 @@ void BBTCOView::setColor( QColor new_color ) } +void BBTCOView::update() +{ + ToolTip::add(this, m_bbTCO->name()); + + TrackContentObjectView::update(); +} diff --git a/src/tracks/Pattern.cpp b/src/tracks/Pattern.cpp index 119124ab1ed..1bcd5e4b2b1 100644 --- a/src/tracks/Pattern.cpp +++ b/src/tracks/Pattern.cpp @@ -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(); }