mirror of
https://github.com/YACReader/yacreader
synced 2025-05-25 18:00:46 -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);
|
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)
|
BusyIndicator::BusyIndicator(QWidget *parent, int size)
|
||||||
: QWidget(parent),
|
: QWidget(parent),
|
||||||
startAngle(0),
|
startAngle(0),
|
||||||
@ -167,13 +159,14 @@ void BusyIndicator::paintEvent(QPaintEvent *)
|
|||||||
.arg(m_style);
|
.arg(m_style);
|
||||||
|
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
|
pixmap.setDevicePixelRatio(devicePixelRatioF());
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
painter.setRenderHint(QPainter::Antialiasing);
|
painter.setRenderHint(QPainter::Antialiasing);
|
||||||
|
|
||||||
int side = qMin(width(), height());
|
int side = qMin(width(), height());
|
||||||
|
|
||||||
if (!QPixmapCache::find(key, &pixmap)) {
|
if (!QPixmapCache::find(key, &pixmap)) {
|
||||||
pixmap = generatePixmap(side);
|
pixmap = generatePixmap(side * devicePixelRatioF());
|
||||||
QPixmapCache::insert(key, pixmap);
|
QPixmapCache::insert(key, pixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ class YACReaderBusyWidget : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit YACReaderBusyWidget(QWidget *parent = 0);
|
explicit YACReaderBusyWidget(QWidget *parent = 0);
|
||||||
void paintEvent(QPaintEvent *);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class BusyIndicator : public QWidget
|
class BusyIndicator : public QWidget
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 327 B |
Loading…
Reference in New Issue
Block a user