From 5f4c8ba2a9ff9a1703d6b802217fa62494dfa533 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Wed, 14 Nov 2012 03:59:40 +0100 Subject: [PATCH] * Fixed artist & album name being cut off on track page. --- src/libtomahawk/widgets/QueryLabel.cpp | 26 +------------------------- src/libtomahawk/widgets/QueryLabel.h | 6 +----- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/src/libtomahawk/widgets/QueryLabel.cpp b/src/libtomahawk/widgets/QueryLabel.cpp index 5062a8a2d..dd436691d 100644 --- a/src/libtomahawk/widgets/QueryLabel.cpp +++ b/src/libtomahawk/widgets/QueryLabel.cpp @@ -89,7 +89,6 @@ QueryLabel::init() setMouseTracking( true ); m_useCustomPen = false; - m_useCustomFont = false; m_align = Qt::AlignLeft | Qt::AlignVCenter; m_mode = Qt::ElideMiddle; @@ -308,21 +307,6 @@ QueryLabel::setElideMode( Qt::TextElideMode mode ) } -QFont -QueryLabel::font() const -{ - return m_font; -} - - -void -QueryLabel::setFont( const QFont& font ) -{ - m_useCustomFont = true; - m_font = font; -} - - void QueryLabel::updateLabel() { @@ -381,17 +365,11 @@ QueryLabel::paintEvent( QPaintEvent* event ) QRect r = contentsRect(); QString s = text(); const QString elidedText = fontMetrics().elidedText( s, m_mode, r.width() ); + const QFontMetrics& fm = fontMetrics(); p.save(); p.setRenderHint( QPainter::Antialiasing ); - QFontMetrics fm = fontMetrics(); - if ( m_useCustomFont ) - { - p.setFont( m_font ); - fm = QFontMetrics( m_font ); - } - if ( m_hoverArea.width() ) { if ( elidedText != s ) @@ -601,8 +579,6 @@ QueryLabel::mouseMoveEvent( QMouseEvent* event ) } QFontMetrics fm = fontMetrics(); - if ( m_useCustomFont ) - fm = QFontMetrics( m_font ); int dashX = fm.width( DASH ); int artistX = m_type & Artist ? fm.width( artist()->name() ) : 0; diff --git a/src/libtomahawk/widgets/QueryLabel.h b/src/libtomahawk/widgets/QueryLabel.h index 88e7d9f12..9b0515726 100644 --- a/src/libtomahawk/widgets/QueryLabel.h +++ b/src/libtomahawk/widgets/QueryLabel.h @@ -77,9 +77,6 @@ public: void setTextPen( const QPen& ); QPen textPen() const; - void setFont( const QFont& ); - QFont font() const; - void setExtraContentsMargins( int left, int top, int right, int bottom ); void setJumpLinkVisible( bool visible ); @@ -136,9 +133,8 @@ private: Qt::Alignment m_align; Qt::TextElideMode m_mode; - bool m_useCustomPen, m_useCustomFont; + bool m_useCustomPen; QPen m_textPen; - QFont m_font; DisplayType m_hoverType; QRect m_hoverArea;