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