elide the text on track button if it's too lon... (#3328)

* Elide the text on track button if it's too long
* Remove setText() from paintEvent
* Dynamic trackLabelButton width
This commit is contained in:
Steffen Baranowsky
2017-02-20 17:44:21 +01:00
committed by Tres Finocchiaro
parent 2c8e9a0957
commit 5863752988
2 changed files with 46 additions and 15 deletions

View File

@@ -44,6 +44,7 @@ public:
public slots:
void rename();
void renameFinished();
void nameChanged();
protected:
@@ -53,6 +54,7 @@ protected:
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
virtual void mouseReleaseEvent( QMouseEvent * _me );
virtual void paintEvent( QPaintEvent * _pe );
virtual void resizeEvent( QResizeEvent * _re );
private:
@@ -60,6 +62,7 @@ private:
QString m_iconName;
QLineEdit * m_renameLineEdit;
QRect m_buttonRect;
QString elideName( const QString &name );
} ;