mirror of
https://github.com/libretro/Mu.git
synced 2026-09-23 23:25:04 +00:00
Clean up the GUI some
Next is all the icons and updating the silkscreen svg.
This commit is contained in:
@@ -34,9 +34,6 @@
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Close</set>
|
||||
</property>
|
||||
<property name="centerButtons">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
@@ -60,6 +57,9 @@
|
||||
<property name="text">
|
||||
<string>Show Registers</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="3">
|
||||
@@ -67,6 +67,9 @@
|
||||
<property name="text">
|
||||
<string>Get Hex Values</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="10">
|
||||
@@ -84,6 +87,9 @@
|
||||
<property name="text">
|
||||
<string>Print Debug Logs</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1" colspan="3">
|
||||
@@ -91,6 +97,9 @@
|
||||
<property name="text">
|
||||
<string>Erase Debug Logs</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1" colspan="3">
|
||||
@@ -98,6 +107,9 @@
|
||||
<property name="text">
|
||||
<string>Dump To File</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="3">
|
||||
|
||||
@@ -28,8 +28,10 @@ MainWindow::MainWindow(QWidget* parent) :
|
||||
refreshDisplay = new QTimer(this);
|
||||
|
||||
//this makes the display window and button icons resize properly
|
||||
ui->displayContainer->installEventFilter(this);
|
||||
ui->displayContainer->setObjectName("displayContainer");
|
||||
ui->centralWidget->installEventFilter(this);
|
||||
ui->centralWidget->setObjectName("centralWidget");
|
||||
//ui->displayContainer->installEventFilter(this);
|
||||
//ui->displayContainer->setObjectName("displayContainer");
|
||||
|
||||
ui->calendar->installEventFilter(this);
|
||||
ui->addressBook->installEventFilter(this);
|
||||
@@ -45,10 +47,13 @@ MainWindow::MainWindow(QWidget* parent) :
|
||||
ui->power->installEventFilter(this);
|
||||
|
||||
ui->screenshot->installEventFilter(this);
|
||||
ui->ctrlBtn->installEventFilter(this);
|
||||
//ui->install->installEventFilter(this);//enable when install gets an icon
|
||||
//ui->stateManager->installEventFilter(this);//enable when stateManager gets an icon
|
||||
ui->debugger->installEventFilter(this);
|
||||
|
||||
ui->ctrlBtn->setIcon(QIcon(":/buttons/images/play.png"));
|
||||
ui->ctrlBtn->installEventFilter(this);
|
||||
|
||||
//ui->ctrlBtn->setIcon(QIcon(":/buttons/images/play.png"));
|
||||
|
||||
|
||||
QString resourceDirPath = settings.value("resourceDirectory", "").toString();
|
||||
@@ -71,7 +76,6 @@ MainWindow::MainWindow(QWidget* parent) :
|
||||
|
||||
#if !defined(EMU_DEBUG) || defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
||||
ui->debugger->hide();
|
||||
ui->touchscreenState->hide();
|
||||
#endif
|
||||
|
||||
connect(refreshDisplay, SIGNAL(timeout()), this, SLOT(updateDisplay()));
|
||||
@@ -108,8 +112,13 @@ bool MainWindow::eventFilter(QObject *object, QEvent *event){
|
||||
button->setIconSize(QSize(button->size().width() / 1.7, button->size().height() / 1.7));
|
||||
}
|
||||
|
||||
if(object->objectName() == "displayContainer"){
|
||||
double smallestRatio = qMin(ui->displayContainer->size().width() * 0.98 / 3.0 , ui->displayContainer->size().height() * 0.98 / 4.0);
|
||||
if(object->objectName() == "centralWidget"){
|
||||
double smallestRatio;
|
||||
|
||||
//update displayContainer first, make the display occupy the top 3/4 of the screen
|
||||
ui->displayContainer->setFixedHeight(ui->centralWidget->height() * 0.75);
|
||||
|
||||
smallestRatio = qMin(ui->displayContainer->size().width() * 0.98 / 3.0 , ui->displayContainer->size().height() * 0.98 / 4.0);
|
||||
//the 0.98 above allows the display to shrink, without it the displayContainer couldent shrink because of the fixed size of the display
|
||||
|
||||
//set new size
|
||||
@@ -155,11 +164,6 @@ void MainWindow::updateDisplay(){
|
||||
ui->ctrlBtn->setIcon(QIcon(":/buttons/images/play.png"));
|
||||
emuDebugger->exec();
|
||||
}
|
||||
|
||||
#if defined(EMU_DEBUG) && !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
|
||||
if(emu.isRunning())
|
||||
ui->touchscreenState->setText("X:" + QString::number(emu.emuInput.touchscreenX) + ", Y:" + QString::number(emu.emuInput.touchscreenY) + ", Touched:" + (emu.emuInput.touchscreenTouched ? "true" : "false"));
|
||||
#endif
|
||||
}
|
||||
|
||||
//palm buttons
|
||||
@@ -258,8 +262,11 @@ void MainWindow::on_ctrlBtn_clicked(){
|
||||
ui->center->setEnabled(true);
|
||||
*/
|
||||
|
||||
ui->debugger->setEnabled(true);
|
||||
ui->screenshot->setEnabled(true);
|
||||
ui->install->setEnabled(true);
|
||||
ui->stateManager->setEnabled(true);
|
||||
ui->debugger->setEnabled(true);
|
||||
|
||||
ui->ctrlBtn->setIcon(QIcon(":/buttons/images/pause.png"));
|
||||
}
|
||||
else{
|
||||
@@ -288,13 +295,11 @@ void MainWindow::on_debugger_clicked(){
|
||||
}
|
||||
|
||||
void MainWindow::on_screenshot_clicked(){
|
||||
const QPixmap* currentScreenPixmap = ui->display->pixmap();
|
||||
|
||||
if(currentScreenPixmap && !currentScreenPixmap->isNull()){
|
||||
if(emu.isInited()){
|
||||
qlonglong screenshotNumber = settings.value("screenshotNum", 0).toLongLong();
|
||||
QString screenshotPath = settings.value("resourceDirectory", "").toString() + "/screenshots/screenshot" + QString::number(screenshotNumber, 10) + ".png";
|
||||
|
||||
currentScreenPixmap->save(screenshotPath, "PNG", 100);
|
||||
emu.getFramebuffer().save(screenshotPath, "PNG", 100);
|
||||
screenshotNumber++;
|
||||
settings.setValue("screenshotNum", screenshotNumber);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>388</width>
|
||||
<width>365</width>
|
||||
<height>478</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -29,6 +29,12 @@
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="displayContainer" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
@@ -67,22 +73,6 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="touchscreenState">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Current Touch Data</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="controlPanel" native="true">
|
||||
<property name="enabled">
|
||||
@@ -311,6 +301,9 @@
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="screenshot">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -342,8 +335,11 @@
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QPushButton" name="install">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
||||
@@ -75,6 +75,9 @@
|
||||
<property name="text">
|
||||
<string>Save State</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@@ -82,6 +85,9 @@
|
||||
<property name="text">
|
||||
<string>Load State</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
Reference in New Issue
Block a user