mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-17 19:37:09 +02:00
Fix DropDownButton font size and boldness
This commit is contained in:
@@ -46,6 +46,9 @@ DropDownButton::paintEvent( QPaintEvent* event )
|
||||
{
|
||||
// QComboBox::paintEvent( event );
|
||||
QPainter p( this );
|
||||
|
||||
setupPainter( &p );
|
||||
|
||||
drawPrimitive( &p, contentsRect(), currentText(), true, true );
|
||||
}
|
||||
|
||||
@@ -54,8 +57,8 @@ void
|
||||
DropDownButton::drawPrimitive( QPainter* p, const QRect& rect, const QString& text, bool hovering, bool itemsAvailable )
|
||||
{
|
||||
p->save();
|
||||
QFont f = p->font();
|
||||
f.setPointSize( 8 );
|
||||
|
||||
setupPainter( p );
|
||||
|
||||
p->setRenderHint( QPainter::TextAntialiasing );
|
||||
QRect r = rect.adjusted( 2, 2, -2, -2 );
|
||||
@@ -113,3 +116,13 @@ DropDownButton::mousePressEvent( QMouseEvent* event )
|
||||
event->accept();
|
||||
emit clicked();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DropDownButton::setupPainter( QPainter* p )
|
||||
{
|
||||
QFont f = p->font();
|
||||
f.setPointSize( TomahawkUtils::defaultFontSize() - 1 );
|
||||
f.setBold( true );
|
||||
p->setFont( f );
|
||||
}
|
||||
|
@@ -46,6 +46,7 @@ protected:
|
||||
private slots:
|
||||
|
||||
private:
|
||||
static void setupPainter( QPainter* p );
|
||||
};
|
||||
|
||||
#endif // DROPDOWNBUTTON_H
|
||||
|
Reference in New Issue
Block a user