Skip to content
Browse files

* Fixed artist & album name being cut off on track page.

  • Loading branch information...
1 parent 3a8ea3b commit 5f4c8ba2a9ff9a1703d6b802217fa62494dfa533 @muesli muesli committed Nov 14, 2012
Showing with 2 additions and 30 deletions.
  1. +1 −25 src/libtomahawk/widgets/QueryLabel.cpp
  2. +1 −5 src/libtomahawk/widgets/QueryLabel.h
View
26 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;
View
6 src/libtomahawk/widgets/QueryLabel.h
@@ -77,9 +77,6 @@ Q_OBJECT
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 @@ public slots:
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;

0 comments on commit 5f4c8ba

Please sign in to comment.
Something went wrong with that request. Please try again.