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:
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 );
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user