diff --git a/src/images/controller_icon.png b/src/images/controller_icon.png index 40c92a89b..0d5556329 100644 Binary files a/src/images/controller_icon.png and b/src/images/controller_icon.png differ diff --git a/src/images/fullscreen_icon.png b/src/images/fullscreen_icon.png index 327a30df5..d8a6d3c55 100644 Binary files a/src/images/fullscreen_icon.png and b/src/images/fullscreen_icon.png differ diff --git a/src/images/settings_icon.png b/src/images/settings_icon.png index c88cd7a6f..81127bfa3 100644 Binary files a/src/images/settings_icon.png and b/src/images/settings_icon.png differ diff --git a/src/qt_gui/main_window.cpp b/src/qt_gui/main_window.cpp index 0215c2b7f..bae6cc897 100644 --- a/src/qt_gui/main_window.cpp +++ b/src/qt_gui/main_window.cpp @@ -153,11 +153,6 @@ void MainWindow::toggleFullscreen() { event.type = SDL_EVENT_TOGGLE_FULLSCREEN; SDL_PushEvent(&event); - - SDL_Event check_event; - while (SDL_PollEvent(&check_event)) { - SDL_PushEvent(&check_event); - } } void MainWindow::AddUiWidgets() { @@ -173,34 +168,28 @@ void MainWindow::AddUiWidgets() { mainLayout->setSpacing(15); bool showLabels = ui->toggleLabelsAct->isChecked(); + QPalette palette = qApp->palette(); auto createButtonWithLabel = [&](QPushButton* button, const QString& labelText) { QWidget* container = new QWidget(this); QVBoxLayout* layout = new QVBoxLayout(container); layout->setAlignment(Qt::AlignHCenter | Qt::AlignBottom); layout->setContentsMargins(0, 0, 0, 0); - layout->addWidget(button); - if (ui->toggleLabelsAct->isChecked()) { + if (showLabels) { QLabel* label = new QLabel(labelText, this); - label->setAlignment(Qt::AlignCenter); + label->setAlignment(Qt::AlignCenter | Qt::AlignBottom); layout->addWidget(label); + button->setToolTip(""); } else { - - button->setToolTip( - QString("%2") - .arg(palette().color(QPalette::Window).lightness() > 128 ? "#000" : "#000", - labelText)); + button->setToolTip(labelText); } container->setLayout(layout); return container; }; - QWidget* buttonGroup = new QWidget(this); - QHBoxLayout* buttonLayout = new QHBoxLayout(buttonGroup); - auto createLine = [this]() { QFrame* line = new QFrame(this); line->setFrameShape(QFrame::VLine); @@ -209,22 +198,19 @@ void MainWindow::AddUiWidgets() { return line; }; + QWidget* buttonGroup = new QWidget(this); + QHBoxLayout* buttonLayout = new QHBoxLayout(buttonGroup); buttonLayout->setContentsMargins(0, 0, 0, 0); buttonLayout->setSpacing(15); buttonLayout->addWidget(createButtonWithLabel(ui->playButton, tr("Play"))); buttonLayout->addWidget(createButtonWithLabel(ui->pauseButton, tr("Pause"))); buttonLayout->addWidget(createButtonWithLabel(ui->stopButton, tr("Stop"))); - buttonLayout->addWidget(createLine()); - buttonLayout->addWidget(createButtonWithLabel(ui->settingsButton, tr("Settings"))); buttonLayout->addWidget(createButtonWithLabel(ui->fullscreenButton, tr("Full Screen"))); - buttonLayout->addWidget(createLine()); - buttonLayout->addWidget(createButtonWithLabel(ui->controllerButton, tr("Controllers"))); buttonLayout->addWidget(createButtonWithLabel(ui->keyboardButton, tr("Keyboard"))); buttonLayout->addWidget(createButtonWithLabel(ui->refreshButton, tr("Refresh List"))); - buttonLayout->addWidget(createLine()); QWidget* searchSliderContainer = new QWidget(this); QHBoxLayout* searchSliderLayout = new QHBoxLayout(searchSliderContainer); @@ -232,14 +218,12 @@ void MainWindow::AddUiWidgets() { searchSliderLayout->setSpacing(10); searchSliderLayout->addWidget(ui->sizeSliderContainer); - searchSliderLayout->addWidget(ui->mw_searchbar); - searchSliderContainer->setLayout(searchSliderLayout); - mainLayout->addWidget(buttonGroup); - mainLayout->addWidget(searchSliderContainer); + buttonLayout->addWidget(searchSliderContainer); + mainLayout->addWidget(buttonGroup); toolbarContainer->setLayout(mainLayout); ui->toolBar->addWidget(toolbarContainer); } diff --git a/src/qt_gui/main_window.h b/src/qt_gui/main_window.h index 54127cb2d..9022b88c6 100644 --- a/src/qt_gui/main_window.h +++ b/src/qt_gui/main_window.h @@ -75,7 +75,6 @@ private: void PlayBackgroundMusic(); QIcon RecolorIcon(const QIcon& icon, bool isWhite); void StartEmulator(std::filesystem::path); - bool is_paused = false; bool isIconBlack = false; bool isTableList = true; bool isGameRunning = false; diff --git a/src/qt_gui/main_window_themes.cpp b/src/qt_gui/main_window_themes.cpp index 96aab3304..3a36a5ac6 100644 --- a/src/qt_gui/main_window_themes.cpp +++ b/src/qt_gui/main_window_themes.cpp @@ -19,7 +19,7 @@ void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) { themePalette.setColor(QPalette::WindowText, Qt::white); themePalette.setColor(QPalette::Base, QColor(20, 20, 20)); themePalette.setColor(QPalette::AlternateBase, QColor(53, 53, 53)); - themePalette.setColor(QPalette::ToolTipBase, Qt::white); + themePalette.setColor(QPalette::ToolTipBase, QColor(20, 20, 20)); themePalette.setColor(QPalette::ToolTipText, Qt::white); themePalette.setColor(QPalette::Text, Qt::white); themePalette.setColor(QPalette::Button, QColor(53, 53, 53)); @@ -40,8 +40,8 @@ void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) { themePalette.setColor(QPalette::Window, QColor(240, 240, 240)); // Light gray themePalette.setColor(QPalette::WindowText, Qt::black); // Black themePalette.setColor(QPalette::Base, QColor(230, 230, 230, 80)); // Grayish - themePalette.setColor(QPalette::ToolTipBase, Qt::white); // Black - themePalette.setColor(QPalette::ToolTipText, Qt::black); // Black + themePalette.setColor(QPalette::ToolTipBase, QColor(230, 230, 230, 80)); // Grayish + themePalette.setColor(QPalette::ToolTipText, Qt::black); // Black themePalette.setColor(QPalette::Text, Qt::black); // Black themePalette.setColor(QPalette::Button, QColor(240, 240, 240)); // Light gray themePalette.setColor(QPalette::ButtonText, Qt::black); // Black @@ -63,7 +63,8 @@ void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) { themePalette.setColor(QPalette::Base, QColor(25, 40, 25)); // Darker green base themePalette.setColor(QPalette::AlternateBase, QColor(53, 69, 53)); // Dark green alternate base - themePalette.setColor(QPalette::ToolTipBase, Qt::white); // White tooltip background + themePalette.setColor(QPalette::ToolTipBase, + QColor(25, 40, 25)); // White tooltip background themePalette.setColor(QPalette::ToolTipText, Qt::white); // White tooltip text themePalette.setColor(QPalette::Text, Qt::white); // White text themePalette.setColor(QPalette::Button, QColor(53, 69, 53)); // Dark green button @@ -86,7 +87,8 @@ void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) { themePalette.setColor(QPalette::Base, QColor(20, 40, 60)); // Darker blue base themePalette.setColor(QPalette::AlternateBase, QColor(40, 60, 90)); // Dark blue alternate base - themePalette.setColor(QPalette::ToolTipBase, Qt::white); // White tooltip background + themePalette.setColor(QPalette::ToolTipBase, + QColor(20, 40, 60)); // White tooltip background themePalette.setColor(QPalette::ToolTipText, Qt::white); // White tooltip text themePalette.setColor(QPalette::Text, Qt::white); // White text themePalette.setColor(QPalette::Button, QColor(40, 60, 90)); // Dark blue button @@ -110,7 +112,8 @@ void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) { themePalette.setColor(QPalette::Base, QColor(80, 30, 90)); // Darker violet base themePalette.setColor(QPalette::AlternateBase, QColor(100, 50, 120)); // Violet alternate base - themePalette.setColor(QPalette::ToolTipBase, Qt::white); // White tooltip background + themePalette.setColor(QPalette::ToolTipBase, + QColor(80, 30, 90)); // White tooltip background themePalette.setColor(QPalette::ToolTipText, Qt::white); // White tooltip text themePalette.setColor(QPalette::Text, Qt::white); // White text themePalette.setColor(QPalette::Button, QColor(100, 50, 120)); // Violet button @@ -133,7 +136,7 @@ void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) { themePalette.setColor(QPalette::WindowText, QColor(249, 245, 215)); themePalette.setColor(QPalette::Base, QColor(29, 32, 33)); themePalette.setColor(QPalette::AlternateBase, QColor(50, 48, 47)); - themePalette.setColor(QPalette::ToolTipBase, QColor(249, 245, 215)); + themePalette.setColor(QPalette::ToolTipBase, QColor(29, 32, 33)); themePalette.setColor(QPalette::ToolTipText, QColor(249, 245, 215)); themePalette.setColor(QPalette::Text, QColor(249, 245, 215)); themePalette.setColor(QPalette::Button, QColor(40, 40, 40)); @@ -155,7 +158,7 @@ void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) { themePalette.setColor(QPalette::WindowText, QColor(192, 202, 245)); themePalette.setColor(QPalette::Base, QColor(25, 28, 39)); themePalette.setColor(QPalette::AlternateBase, QColor(36, 40, 59)); - themePalette.setColor(QPalette::ToolTipBase, QColor(192, 202, 245)); + themePalette.setColor(QPalette::ToolTipBase, QColor(25, 28, 39)); themePalette.setColor(QPalette::ToolTipText, QColor(192, 202, 245)); themePalette.setColor(QPalette::Text, QColor(192, 202, 245)); themePalette.setColor(QPalette::Button, QColor(30, 30, 41)); @@ -173,7 +176,7 @@ void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) { themePalette.setColor(QPalette::WindowText, Qt::white); themePalette.setColor(QPalette::Base, Qt::black); themePalette.setColor(QPalette::AlternateBase, Qt::black); - themePalette.setColor(QPalette::ToolTipBase, Qt::white); + themePalette.setColor(QPalette::ToolTipBase, Qt::black); themePalette.setColor(QPalette::ToolTipText, Qt::white); themePalette.setColor(QPalette::Text, Qt::white); themePalette.setColor(QPalette::Button, QColor(5, 5, 5)); diff --git a/src/qt_gui/main_window_ui.h b/src/qt_gui/main_window_ui.h index bb16560ad..2cf3d0ae8 100644 --- a/src/qt_gui/main_window_ui.h +++ b/src/qt_gui/main_window_ui.h @@ -229,15 +229,15 @@ public: settingsButton = new QPushButton(centralWidget); settingsButton->setFlat(true); settingsButton->setIcon(QIcon(":images/settings_icon.png")); - settingsButton->setIconSize(QSize(42, 42)); + settingsButton->setIconSize(QSize(40, 40)); controllerButton = new QPushButton(centralWidget); controllerButton->setFlat(true); controllerButton->setIcon(QIcon(":images/controller_icon.png")); - controllerButton->setIconSize(QSize(40, 40)); + controllerButton->setIconSize(QSize(55, 48)); keyboardButton = new QPushButton(centralWidget); keyboardButton->setFlat(true); keyboardButton->setIcon(QIcon(":images/keyboard_icon.png")); - keyboardButton->setIconSize(QSize(48, 44)); + keyboardButton->setIconSize(QSize(50, 50)); sizeSliderContainer = new QWidget(centralWidget); sizeSliderContainer->setObjectName("sizeSliderContainer"); diff --git a/src/sdl_window.cpp b/src/sdl_window.cpp index bf7e76873..00fc5603f 100644 --- a/src/sdl_window.cpp +++ b/src/sdl_window.cpp @@ -404,13 +404,13 @@ void WindowSDL::WaitEvent() { } case SDL_EVENT_TOGGLE_PAUSE: SDL_Log("Received SDL_EVENT_TOGGLE_PAUSE"); - is_paused = !is_paused; - if (is_paused) { - SDL_Log("Game Paused"); - DebugState.PauseGuestThreads(); - } else { + + if (DebugState.IsGuestThreadsPaused()) { SDL_Log("Game Resumed"); DebugState.ResumeGuestThreads(); + } else { + SDL_Log("Game Paused"); + DebugState.PauseGuestThreads(); } break; } diff --git a/src/sdl_window.h b/src/sdl_window.h index 2b1505767..48a9be58c 100644 --- a/src/sdl_window.h +++ b/src/sdl_window.h @@ -108,7 +108,6 @@ private: SDL_Window* window{}; bool is_shown{}; bool is_open{true}; - bool is_paused = false; }; } // namespace Frontend