all repos — mgba @ 00e8b9877f76420e1e85c34cc2a156d1a52b8a30

mGBA Game Boy Advance Emulator

Qt: Add reset button to frame inspector
Vicki Pfau vi@endrift.com
Sun, 02 Jun 2019 15:56:21 -0700
commit

00e8b9877f76420e1e85c34cc2a156d1a52b8a30

parent

427e3a61029a8c49f7dbd4edc4ad4400f6427866

3 files changed, 40 insertions(+), 22 deletions(-)

jump to
M src/platform/qt/FrameView.cppsrc/platform/qt/FrameView.cpp

@@ -64,6 +64,7 @@ connect(m_ui.magnification, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, [this]() {

invalidateQueue(); }); connect(m_ui.exportButton, &QAbstractButton::pressed, this, &FrameView::exportFrame); + connect(m_ui.reset, &QAbstractButton::pressed, this, &FrameView::reset); m_backdropPicker = ColorPicker(m_ui.backdrop, QColor(0, 0, 0, 0)); connect(&m_backdropPicker, &ColorPicker::colorChanged, this, [this](const QColor& color) {

@@ -430,6 +431,15 @@ QString filename = GBAApp::app()->getSaveFileName(this, tr("Export frame"),

tr("Portable Network Graphics (*.png)")); CoreController::Interrupter interrupter(m_controller); m_framebuffer.save(filename, "PNG"); +} + +void FrameView::reset() { + m_disabled.clear(); + for (Layer& layer : m_queue) { + layer.enabled = true; + } + m_overrideBackdrop = QColor(); + invalidateQueue(); } QString FrameView::LayerId::readable() const {
M src/platform/qt/FrameView.hsrc/platform/qt/FrameView.h

@@ -39,6 +39,7 @@ public slots:

void selectLayer(const QPointF& coord); void disableLayer(const QPointF& coord); void exportFrame(); + void reset(); protected: #ifdef M_CORE_GBA
M src/platform/qt/FrameView.uisrc/platform/qt/FrameView.ui

@@ -13,7 +13,7 @@ </property>

<property name="windowTitle"> <string>Inspect frame</string> </property> - <layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,1,0" columnstretch="0,1"> + <layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,1,0,0,0" columnstretch="0,1"> <item row="0" column="0"> <layout class="QHBoxLayout" name="horizontalLayout_4"> <item>

@@ -87,27 +87,7 @@ </widget>

</item> </layout> </item> - <item row="2" column="0"> - <widget class="QCheckBox" name="disableScanline"> - <property name="text"> - <string>Disable scanline effects</string> - </property> - </widget> - </item> - <item row="4" column="0" rowspan="2"> - <widget class="QListWidget" name="queue"/> - </item> - <item row="6" column="0"> - <widget class="QPushButton" name="exportButton"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="text"> - <string>Export</string> - </property> - </widget> - </item> - <item row="0" column="1" rowspan="7"> + <item row="0" column="1" rowspan="9"> <widget class="QScrollArea" name="compositedArea"> <property name="widgetResizable"> <bool>true</bool>

@@ -144,6 +124,33 @@ </spacer>

</item> </layout> </widget> + </widget> + </item> + <item row="2" column="0"> + <widget class="QCheckBox" name="disableScanline"> + <property name="text"> + <string>Disable scanline effects</string> + </property> + </widget> + </item> + <item row="5" column="0" rowspan="2"> + <widget class="QListWidget" name="queue"/> + </item> + <item row="8" column="0"> + <widget class="QPushButton" name="exportButton"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>Export</string> + </property> + </widget> + </item> + <item row="7" column="0"> + <widget class="QPushButton" name="reset"> + <property name="text"> + <string>Reset</string> + </property> </widget> </item> </layout>