Commit 2c62c0b5 authored by Pierre Lamot's avatar Pierre Lamot Committed by Jean-Baptiste Kempf

qt: fix rendering of FramelessButton with HiDpi

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent fe4fcce2
......@@ -93,7 +93,9 @@ void PLSelItem::addAction( ItemAction act, const QString& tooltip )
lblAction = new SelectorActionButton();
lblAction->setIcon( icon );
lblAction->setMinimumWidth( lblAction->sizeHint().width() + 6 );
int icon_size = fontMetrics().height();
lblAction->setIconSize( QSize( icon_size, icon_size ) );
lblAction->setMinimumWidth( lblAction->sizeHint().width() + icon_size );
if( !tooltip.isEmpty() ) lblAction->setToolTip( tooltip );
......
......@@ -50,9 +50,8 @@ QFramelessButton::QFramelessButton( QWidget *parent )
void QFramelessButton::paintEvent( QPaintEvent * )
{
QPainter painter( this );
QPixmap pix = icon().pixmap( size() );
QPoint pos( (width() - pix.width()) / 2, (height() - pix.height()) / 2 );
painter.drawPixmap( QRect( pos.x(), pos.y(), pix.width(), pix.height() ), pix );
icon().paint(&painter, QRect( 0, 0, width(), height()));
}
QElidingLabel::QElidingLabel( const QString &s, Qt::TextElideMode mode, QWidget * parent )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment