1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01:00

* No need to re-set default font. Implement proper size-hint for CaptionLabel.

This commit is contained in:
Christian Muehlhaeuser 2014-08-23 16:58:20 +02:00
parent a52082eb04
commit 1025dc3cc2

@ -30,11 +30,6 @@ CaptionLabel::CaptionLabel( QWidget* parent )
, m_parent( parent )
, m_showCloseButton( false )
{
QFont f = font();
f.setPointSize( 10 );
setFont( f );
setFixedHeight( QFontMetrics( f ).height() + 12 );
setMouseTracking( true );
setShowCloseButton( m_showCloseButton );
@ -49,7 +44,8 @@ CaptionLabel::~CaptionLabel()
QSize
CaptionLabel::sizeHint() const
{
return QLabel::sizeHint();
QFontMetrics fm( font() );
return QSize( fm.width( text().toUpper() ), fm.height() * 1.7 );
}