mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 00:54:53 -07:00
Themes: remove all hardcoded extensions
This commit is contained in:
parent
226a8cc017
commit
00e3e63f41
27 changed files with 348 additions and 419 deletions
|
|
@ -1,5 +1,4 @@
|
|||
#include <QPainter>
|
||||
#include <QSvgRenderer>
|
||||
#include <QPixmapCache>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include "handcounter.h"
|
||||
|
|
@ -36,11 +35,7 @@ void HandCounter::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*op
|
|||
#else
|
||||
if (!QPixmapCache::find("handCounter" + QString::number(translatedSize.width()), cachedPixmap)) {
|
||||
#endif
|
||||
QSvgRenderer svg(QString("theme:hand.svg"));
|
||||
cachedPixmap = QPixmap(translatedSize);
|
||||
cachedPixmap.fill(Qt::transparent);
|
||||
QPainter painter(&cachedPixmap);
|
||||
svg.render(&painter, QRectF(0, 0, translatedSize.width(), translatedSize.height()));
|
||||
cachedPixmap = QPixmap("theme:hand").scaled(translatedSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
QPixmapCache::insert("handCounter" + QString::number(translatedSize.width()), cachedPixmap);
|
||||
}
|
||||
painter->resetTransform();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue