mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
* No need to re-set default font. Implement proper size-hint for CaptionLabel.
This commit is contained in:
@@ -30,11 +30,6 @@ CaptionLabel::CaptionLabel( QWidget* parent )
|
|||||||
, m_parent( parent )
|
, m_parent( parent )
|
||||||
, m_showCloseButton( false )
|
, m_showCloseButton( false )
|
||||||
{
|
{
|
||||||
QFont f = font();
|
|
||||||
f.setPointSize( 10 );
|
|
||||||
setFont( f );
|
|
||||||
|
|
||||||
setFixedHeight( QFontMetrics( f ).height() + 12 );
|
|
||||||
setMouseTracking( true );
|
setMouseTracking( true );
|
||||||
|
|
||||||
setShowCloseButton( m_showCloseButton );
|
setShowCloseButton( m_showCloseButton );
|
||||||
@@ -49,7 +44,8 @@ CaptionLabel::~CaptionLabel()
|
|||||||
QSize
|
QSize
|
||||||
CaptionLabel::sizeHint() const
|
CaptionLabel::sizeHint() const
|
||||||
{
|
{
|
||||||
return QLabel::sizeHint();
|
QFontMetrics fm( font() );
|
||||||
|
return QSize( fm.width( text().toUpper() ), fm.height() * 1.7 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user