all repos — mgba @ f33c5f55131a2ec4a4d8be7a729ee63d5adb0636

mGBA Game Boy Advance Emulator

Qt: Add cancel button to savestate view
Vicki Pfau vi@endrift.com
Sat, 08 Jun 2019 16:21:46 -0700
commit

f33c5f55131a2ec4a4d8be7a729ee63d5adb0636

parent

763eccd69a740c62ae283c7f7adfa0f532dfb34a

2 files changed, 55 insertions(+), 41 deletions(-)

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

@@ -65,6 +65,7 @@ escape->setShortcut(QKeySequence("Esc"));

escape->setShortcutContext(Qt::WidgetWithChildrenShortcut); addAction(escape); + connect(m_ui.cancel, &QAbstractButton::clicked, this, &QWidget::close); connect(m_controller.get(), &CoreController::stopping, this, &QWidget::close); }
M src/platform/qt/LoadSaveState.uisrc/platform/qt/LoadSaveState.ui

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

<property name="windowTitle"> <string>%1 State</string> </property> - <layout class="QGridLayout" name="gridLayout_2" rowstretch="1,0,0,0" columnstretch="0,0,0"> + <layout class="QGridLayout" name="gridLayout_2" rowstretch="1,0,0,0,0" columnstretch="0,0,0"> <property name="leftMargin"> <number>6</number> </property>

@@ -29,8 +29,8 @@ </property>

<property name="spacing"> <number>2</number> </property> - <item row="1" column="0"> - <widget class="QGBA::SavestateButton" name="state1"> + <item row="2" column="1"> + <widget class="QGBA::SavestateButton" name="state5"> <property name="sizePolicy"> <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> <horstretch>0</horstretch>

@@ -47,56 +47,56 @@ <height>160</height>

</size> </property> <property name="shortcut"> - <string>1</string> + <string>5</string> </property> </widget> </item> - <item row="1" column="1"> - <widget class="QGBA::SavestateButton" name="state2"> + <item row="0" column="0" colspan="3"> + <widget class="QLabel" name="lsLabel"> <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> + <property name="styleSheet"> + <string notr="true">font-size: 30pt; font-weight: bold; color: white;</string> + </property> <property name="text"> - <string>No Save</string> + <string>%1 State</string> </property> - <property name="iconSize"> - <size> - <width>240</width> - <height>160</height> - </size> + <property name="scaledContents"> + <bool>false</bool> </property> - <property name="shortcut"> - <string>2</string> + <property name="alignment"> + <set>Qt::AlignCenter</set> </property> </widget> </item> - <item row="0" column="0" colspan="3"> - <widget class="QLabel" name="lsLabel"> + <item row="2" column="2"> + <widget class="QGBA::SavestateButton" name="state6"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="styleSheet"> - <string notr="true">font-size: 30pt; font-weight: bold; color: white;</string> - </property> <property name="text"> - <string>%1 State</string> + <string>No Save</string> </property> - <property name="scaledContents"> - <bool>false</bool> + <property name="iconSize"> + <size> + <width>240</width> + <height>160</height> + </size> </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> + <property name="shortcut"> + <string>6</string> </property> </widget> </item> - <item row="1" column="2"> - <widget class="QGBA::SavestateButton" name="state3"> + <item row="3" column="1"> + <widget class="QGBA::SavestateButton" name="state8"> <property name="sizePolicy"> <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> <horstretch>0</horstretch>

@@ -113,7 +113,7 @@ <height>160</height>

</size> </property> <property name="shortcut"> - <string>3</string> + <string>8</string> </property> </widget> </item>

@@ -139,8 +139,8 @@ <string>4</string>

</property> </widget> </item> - <item row="2" column="1"> - <widget class="QGBA::SavestateButton" name="state5"> + <item row="1" column="0"> + <widget class="QGBA::SavestateButton" name="state1"> <property name="sizePolicy"> <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> <horstretch>0</horstretch>

@@ -157,12 +157,12 @@ <height>160</height>

</size> </property> <property name="shortcut"> - <string>5</string> + <string>1</string> </property> </widget> </item> - <item row="2" column="2"> - <widget class="QGBA::SavestateButton" name="state6"> + <item row="1" column="2"> + <widget class="QGBA::SavestateButton" name="state3"> <property name="sizePolicy"> <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> <horstretch>0</horstretch>

@@ -179,7 +179,7 @@ <height>160</height>

</size> </property> <property name="shortcut"> - <string>6</string> + <string>3</string> </property> </widget> </item>

@@ -205,8 +205,8 @@ <string>7</string>

</property> </widget> </item> - <item row="3" column="1"> - <widget class="QGBA::SavestateButton" name="state8"> + <item row="3" column="2"> + <widget class="QGBA::SavestateButton" name="state9"> <property name="sizePolicy"> <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> <horstretch>0</horstretch>

@@ -223,12 +223,12 @@ <height>160</height>

</size> </property> <property name="shortcut"> - <string>8</string> + <string>9</string> </property> </widget> </item> - <item row="3" column="2"> - <widget class="QGBA::SavestateButton" name="state9"> + <item row="1" column="1"> + <widget class="QGBA::SavestateButton" name="state2"> <property name="sizePolicy"> <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> <horstretch>0</horstretch>

@@ -245,7 +245,20 @@ <height>160</height>

</size> </property> <property name="shortcut"> - <string>9</string> + <string>2</string> + </property> + </widget> + </item> + <item row="4" column="1" alignment="Qt::AlignHCenter"> + <widget class="QPushButton" name="cancel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Cancel</string> </property> </widget> </item>