diff --git a/res/keymap.png b/res/keymap.png deleted file mode 100644 index 0c94d2c8d..000000000 Binary files a/res/keymap.png and /dev/null differ diff --git a/res/keymap.qpic b/res/keymap.qpic new file mode 100644 index 000000000..ffb7f8b7d Binary files /dev/null and b/res/keymap.qpic differ diff --git a/src/platform/qt/GBAKeyEditor.cpp b/src/platform/qt/GBAKeyEditor.cpp index b69f5c8fd..4f80f5c73 100644 --- a/src/platform/qt/GBAKeyEditor.cpp +++ b/src/platform/qt/GBAKeyEditor.cpp @@ -2,7 +2,6 @@ #include #include -#include #include #include "InputController.h" @@ -21,9 +20,7 @@ const qreal GBAKeyEditor::DPAD_HEIGHT = 0.1; GBAKeyEditor::GBAKeyEditor(InputController* controller, int type, QWidget* parent) : QWidget(parent) - , m_background(QString(":/res/keymap.png")) { - setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); setWindowFlags(windowFlags() & ~Qt::WindowFullscreenButtonHint); setMinimumSize(300, 300); @@ -118,9 +115,7 @@ GBAKeyEditor::GBAKeyEditor(InputController* controller, int type, QWidget* paren m_currentKey = m_keyOrder.end(); - QPixmap background(":/res/keymap.png"); - m_background = background.scaled(QSize(300, 300) * devicePixelRatio(), Qt::KeepAspectRatio, Qt::SmoothTransformation); - m_background.setDevicePixelRatio(devicePixelRatio()); + m_background.load(":/res/keymap.qpic"); } void GBAKeyEditor::setAll() { @@ -144,7 +139,8 @@ void GBAKeyEditor::resizeEvent(QResizeEvent* event) { void GBAKeyEditor::paintEvent(QPaintEvent* event) { QPainter painter(this); - painter.drawPixmap(0, 0, m_background); + painter.scale(width() / 480.0, height() / 480.0); + painter.drawPicture(0, 0, m_background); } void GBAKeyEditor::setNext() { diff --git a/src/platform/qt/GBAKeyEditor.h b/src/platform/qt/GBAKeyEditor.h index 1f03a9674..06fdb8345 100644 --- a/src/platform/qt/GBAKeyEditor.h +++ b/src/platform/qt/GBAKeyEditor.h @@ -2,7 +2,7 @@ #define QGBA_GBA_KEY_EDITOR #include -#include +#include #include class QPushButton; @@ -51,7 +51,7 @@ private: InputController* m_controller; - QPixmap m_background; + QPicture m_background; }; } diff --git a/src/platform/qt/resources.qrc b/src/platform/qt/resources.qrc index 492193011..8efb247f3 100644 --- a/src/platform/qt/resources.qrc +++ b/src/platform/qt/resources.qrc @@ -1,6 +1,6 @@ ../../../res/mgba-1024.png - ../../../res/keymap.png + ../../../res/keymap.qpic