mirror of
https://github.com/YACReader/yacreader
synced 2025-05-25 09:50:33 -04:00
Fix busy indicator in hdpi
This commit is contained in:
parent
dea3d0a3f7
commit
c5800d98b2
@ -15,14 +15,6 @@ YACReaderBusyWidget::YACReaderBusyWidget(QWidget *parent)
|
||||
busy->move(20, 20);
|
||||
}
|
||||
|
||||
void YACReaderBusyWidget::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
QPainter painter(this);
|
||||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
painter.drawPixmap(0, 0, width(), height(), QPixmap(":/images/busy_background.png"));
|
||||
}
|
||||
|
||||
BusyIndicator::BusyIndicator(QWidget *parent, int size)
|
||||
: QWidget(parent),
|
||||
startAngle(0),
|
||||
@ -167,13 +159,14 @@ void BusyIndicator::paintEvent(QPaintEvent *)
|
||||
.arg(m_style);
|
||||
|
||||
QPixmap pixmap;
|
||||
pixmap.setDevicePixelRatio(devicePixelRatioF());
|
||||
QPainter painter(this);
|
||||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
|
||||
int side = qMin(width(), height());
|
||||
|
||||
if (!QPixmapCache::find(key, &pixmap)) {
|
||||
pixmap = generatePixmap(side);
|
||||
pixmap = generatePixmap(side * devicePixelRatioF());
|
||||
QPixmapCache::insert(key, pixmap);
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,6 @@ class YACReaderBusyWidget : public QWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit YACReaderBusyWidget(QWidget *parent = 0);
|
||||
void paintEvent(QPaintEvent *);
|
||||
};
|
||||
|
||||
class BusyIndicator : public QWidget
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 327 B |
Loading…
Reference in New Issue
Block a user