diff --git a/src/platform/qt/PaletteView.cpp b/src/platform/qt/PaletteView.cpp index a41732672..10a3dd23d 100644 --- a/src/platform/qt/PaletteView.cpp +++ b/src/platform/qt/PaletteView.cpp @@ -41,6 +41,8 @@ void PaletteView::updatePalette() { m_ui.bgGrid->setColor(i, palette[i]); m_ui.objGrid->setColor(i, palette[i + 256]); } + m_ui.bgGrid->update(); + m_ui.objGrid->update(); } void PaletteView::selectIndex(int index) { diff --git a/src/platform/qt/PaletteView.ui b/src/platform/qt/PaletteView.ui index 79a5c2bec..00eb54390 100644 --- a/src/platform/qt/PaletteView.ui +++ b/src/platform/qt/PaletteView.ui @@ -31,6 +31,12 @@ + + + 0 + 0 + + Background @@ -48,22 +54,13 @@ 0 - - - - 0 - 0 - - + 175 175 - - - @@ -101,22 +98,13 @@ 0 - - - - 0 - 0 - - + 175 175 - - - @@ -155,9 +143,9 @@ Selection - + - + 0 @@ -170,36 +158,33 @@ 64 - - - - + Qt::Vertical - + - + Red - + Green - + Blue @@ -208,7 +193,7 @@ - + 8 @@ -236,30 +221,30 @@ - + Qt::Vertical - + - + 16-bit value - + Hex code - + Palette index @@ -268,7 +253,7 @@ - + 8 @@ -312,8 +297,9 @@ QGBA::Swatch - QLabel + QWidget
Swatch.h
+ 1
diff --git a/src/platform/qt/Swatch.cpp b/src/platform/qt/Swatch.cpp index 308bec9cf..8fd834fb6 100644 --- a/src/platform/qt/Swatch.cpp +++ b/src/platform/qt/Swatch.cpp @@ -11,7 +11,7 @@ using namespace QGBA; Swatch::Swatch(QWidget* parent) - : QLabel(parent) + : QWidget(parent) { m_size = 10; setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); @@ -42,8 +42,8 @@ void Swatch::setColor(int index, uint16_t color) { } void Swatch::paintEvent(QPaintEvent* event) { - setPixmap(m_backing); - QLabel::paintEvent(event); + QPainter painter(this); + painter.drawPixmap(QPoint(), m_backing); } void Swatch::mousePressEvent(QMouseEvent* event) { diff --git a/src/platform/qt/Swatch.h b/src/platform/qt/Swatch.h index 5a84c3c38..266b3dca2 100644 --- a/src/platform/qt/Swatch.h +++ b/src/platform/qt/Swatch.h @@ -7,12 +7,12 @@ #define QGBA_SWATCH #include -#include +#include #include namespace QGBA { -class Swatch : public QLabel { +class Swatch : public QWidget { Q_OBJECT public: