mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 03:10:12 +02:00
* Fixed artist & album name being cut off on track page.
This commit is contained in:
@@ -89,7 +89,6 @@ QueryLabel::init()
|
|||||||
setMouseTracking( true );
|
setMouseTracking( true );
|
||||||
|
|
||||||
m_useCustomPen = false;
|
m_useCustomPen = false;
|
||||||
m_useCustomFont = false;
|
|
||||||
m_align = Qt::AlignLeft | Qt::AlignVCenter;
|
m_align = Qt::AlignLeft | Qt::AlignVCenter;
|
||||||
m_mode = Qt::ElideMiddle;
|
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
|
void
|
||||||
QueryLabel::updateLabel()
|
QueryLabel::updateLabel()
|
||||||
{
|
{
|
||||||
@@ -381,17 +365,11 @@ QueryLabel::paintEvent( QPaintEvent* event )
|
|||||||
QRect r = contentsRect();
|
QRect r = contentsRect();
|
||||||
QString s = text();
|
QString s = text();
|
||||||
const QString elidedText = fontMetrics().elidedText( s, m_mode, r.width() );
|
const QString elidedText = fontMetrics().elidedText( s, m_mode, r.width() );
|
||||||
|
const QFontMetrics& fm = fontMetrics();
|
||||||
|
|
||||||
p.save();
|
p.save();
|
||||||
p.setRenderHint( QPainter::Antialiasing );
|
p.setRenderHint( QPainter::Antialiasing );
|
||||||
|
|
||||||
QFontMetrics fm = fontMetrics();
|
|
||||||
if ( m_useCustomFont )
|
|
||||||
{
|
|
||||||
p.setFont( m_font );
|
|
||||||
fm = QFontMetrics( m_font );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( m_hoverArea.width() )
|
if ( m_hoverArea.width() )
|
||||||
{
|
{
|
||||||
if ( elidedText != s )
|
if ( elidedText != s )
|
||||||
@@ -601,8 +579,6 @@ QueryLabel::mouseMoveEvent( QMouseEvent* event )
|
|||||||
}
|
}
|
||||||
|
|
||||||
QFontMetrics fm = fontMetrics();
|
QFontMetrics fm = fontMetrics();
|
||||||
if ( m_useCustomFont )
|
|
||||||
fm = QFontMetrics( m_font );
|
|
||||||
|
|
||||||
int dashX = fm.width( DASH );
|
int dashX = fm.width( DASH );
|
||||||
int artistX = m_type & Artist ? fm.width( artist()->name() ) : 0;
|
int artistX = m_type & Artist ? fm.width( artist()->name() ) : 0;
|
||||||
|
@@ -77,9 +77,6 @@ public:
|
|||||||
void setTextPen( const QPen& );
|
void setTextPen( const QPen& );
|
||||||
QPen textPen() const;
|
QPen textPen() const;
|
||||||
|
|
||||||
void setFont( const QFont& );
|
|
||||||
QFont font() const;
|
|
||||||
|
|
||||||
void setExtraContentsMargins( int left, int top, int right, int bottom );
|
void setExtraContentsMargins( int left, int top, int right, int bottom );
|
||||||
void setJumpLinkVisible( bool visible );
|
void setJumpLinkVisible( bool visible );
|
||||||
|
|
||||||
@@ -136,9 +133,8 @@ private:
|
|||||||
Qt::Alignment m_align;
|
Qt::Alignment m_align;
|
||||||
Qt::TextElideMode m_mode;
|
Qt::TextElideMode m_mode;
|
||||||
|
|
||||||
bool m_useCustomPen, m_useCustomFont;
|
bool m_useCustomPen;
|
||||||
QPen m_textPen;
|
QPen m_textPen;
|
||||||
QFont m_font;
|
|
||||||
|
|
||||||
DisplayType m_hoverType;
|
DisplayType m_hoverType;
|
||||||
QRect m_hoverArea;
|
QRect m_hoverArea;
|
||||||
|
Reference in New Issue
Block a user