diff --git a/CHANGES b/CHANGES index 036e2bf4b..7b2557504 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,7 @@ Bugfixes: - GBA: Reset now reloads multiboot ROMs - GBA BIOS: Fix multiboot entry point (fixes Magic Floor) - Switch: Fix final cleanup (fixes mgba.io/i/1283) + - Qt: Fix tile and sprite views not always displaying at first Misc: - GBA Savedata: EEPROM performance fixes - GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash diff --git a/src/platform/qt/ObjView.cpp b/src/platform/qt/ObjView.cpp index b4c0ae5ac..64b689640 100644 --- a/src/platform/qt/ObjView.cpp +++ b/src/platform/qt/ObjView.cpp @@ -46,6 +46,9 @@ ObjView::ObjView(std::shared_ptr controller, QWidget* parent) m_ui.mode->setFont(font); connect(m_ui.tiles, &TilePainter::indexPressed, this, &ObjView::translateIndex); + connect(m_ui.tiles, &TilePainter::needsRedraw, this, [this]() { + updateTiles(true); + }); connect(m_ui.objId, static_cast(&QSpinBox::valueChanged), this, &ObjView::selectObj); connect(m_ui.magnification, static_cast(&QSpinBox::valueChanged), [this]() { updateTiles(true); diff --git a/src/platform/qt/TilePainter.cpp b/src/platform/qt/TilePainter.cpp index bbf975ca6..042d04732 100644 --- a/src/platform/qt/TilePainter.cpp +++ b/src/platform/qt/TilePainter.cpp @@ -31,6 +31,7 @@ void TilePainter::resizeEvent(QResizeEvent* event) { if (width() / m_size != m_backing.width() / m_size || m_backing.height() != calculatedHeight) { m_backing = QPixmap(width(), calculatedHeight); m_backing.fill(Qt::transparent); + emit needsRedraw(); } } diff --git a/src/platform/qt/TilePainter.h b/src/platform/qt/TilePainter.h index 7cd4c30bb..6adc45419 100644 --- a/src/platform/qt/TilePainter.h +++ b/src/platform/qt/TilePainter.h @@ -26,6 +26,7 @@ public slots: signals: void indexPressed(int index); + void needsRedraw(); protected: void paintEvent(QPaintEvent*) override; diff --git a/src/platform/qt/TileView.cpp b/src/platform/qt/TileView.cpp index 063caf8d3..bc7381f7a 100644 --- a/src/platform/qt/TileView.cpp +++ b/src/platform/qt/TileView.cpp @@ -25,6 +25,9 @@ TileView::TileView(std::shared_ptr controller, QWidget* parent) m_ui.tile->setController(controller); connect(m_ui.tiles, &TilePainter::indexPressed, m_ui.tile, &AssetTile::selectIndex); + connect(m_ui.tiles, &TilePainter::needsRedraw, this, [this]() { + updateTiles(true); + }); connect(m_ui.paletteId, static_cast(&QSpinBox::valueChanged), this, &TileView::updatePalette); switch (m_controller->platform()) {