1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-22 00:42:04 +02:00

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

This commit is contained in:
Christian Muehlhaeuser 2012-11-14 03:59:40 +01:00
parent 3a8ea3be12
commit 5f4c8ba2a9
2 changed files with 2 additions and 30 deletions

View File

@ -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 File

@ -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;