diff --git a/rpcs3/Icons/cog_black.png b/rpcs3/Icons/cog_black.png new file mode 100644 index 0000000000..960f1adc13 Binary files /dev/null and b/rpcs3/Icons/cog_black.png differ diff --git a/rpcs3/Icons/cog_gray.png b/rpcs3/Icons/cog_gray.png new file mode 100644 index 0000000000..b9cf31f05e Binary files /dev/null and b/rpcs3/Icons/cog_gray.png differ diff --git a/rpcs3/Json/tooltips.json b/rpcs3/Json/tooltips.json index 7c95072d11..3b8f388916 100644 --- a/rpcs3/Json/tooltips.json +++ b/rpcs3/Json/tooltips.json @@ -54,7 +54,8 @@ "alwaysStart": "Leave this enabled unless you are a developer.", "startGameFullscreen": "Automatically puts the game window in fullscreen.\nDouble click on the game window or press alt+enter to toggle fullscreen and windowed mode.", "showFPSInTitle": "It can be useful to disable it with buggy screen recording software that fail to select a window with ever changing title.", - "gs_resizeOnBoot": "Automatically resizes the game window on boot.\nThis does not change the internal game resolution." + "gs_resizeOnBoot": "Automatically resizes the game window on boot.\nThis does not change the internal game resolution.", + "gs_disableMouse": "Disables the activation of fullscreen mode per doubleclick while the game screen is active.\nCheck this if you want to play with mouse and keyboard (for example with UCR)." } }, "gpu": { diff --git a/rpcs3/resources.qrc b/rpcs3/resources.qrc index 11d8bf7e6e..553ef477a3 100644 --- a/rpcs3/resources.qrc +++ b/rpcs3/resources.qrc @@ -43,5 +43,7 @@ Icons/play_blue.png Icons/restart_blue.png Icons/stop_blue.png + Icons/cog_black.png + Icons/cog_gray.png diff --git a/rpcs3/rpcs3_app.cpp b/rpcs3/rpcs3_app.cpp index 7defcb07e3..1cc122d580 100644 --- a/rpcs3/rpcs3_app.cpp +++ b/rpcs3/rpcs3_app.cpp @@ -162,13 +162,15 @@ void rpcs3_app::InitializeCallbacks() h = guiSettings->GetValue(GUI::gs_height).toInt(); } + bool disableMouse = guiSettings->GetValue(GUI::gs_disableMouse).toBool(); + switch (video_renderer type = g_cfg.video.renderer) { - case video_renderer::null: return std::make_unique("Null", w, h, RPCS3MainWin->GetAppIcon()); - case video_renderer::opengl: return std::make_unique(w, h, RPCS3MainWin->GetAppIcon()); - case video_renderer::vulkan: return std::make_unique("Vulkan", w, h, RPCS3MainWin->GetAppIcon()); + case video_renderer::null: return std::make_unique("Null", w, h, RPCS3MainWin->GetAppIcon(), disableMouse); + case video_renderer::opengl: return std::make_unique(w, h, RPCS3MainWin->GetAppIcon(), disableMouse); + case video_renderer::vulkan: return std::make_unique("Vulkan", w, h, RPCS3MainWin->GetAppIcon(), disableMouse); #ifdef _MSC_VER - case video_renderer::dx12: return std::make_unique("DirectX 12", w, h, RPCS3MainWin->GetAppIcon()); + case video_renderer::dx12: return std::make_unique("DirectX 12", w, h, RPCS3MainWin->GetAppIcon(), disableMouse); #endif default: fmt::throw_exception("Invalid video renderer: %s" HERE, type); } diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index 5676c19175..d877d03101 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -213,6 +213,13 @@ game_list_frame::game_list_frame(std::shared_ptr settings, const R connect(m_xgrid, &QTableWidget::customContextMenuRequested, this, &game_list_frame::ShowContextMenu); connect(m_Slider_Size, &QSlider::valueChanged, this, &game_list_frame::RequestIconSizeActSet); + connect(m_Slider_Size, &QSlider::sliderReleased, this, [&]{ xgui_settings->SetValue(GUI::gl_iconSize, m_Slider_Size->value()); }); + connect(m_Slider_Size, &QSlider::actionTriggered, [&](int action){ + if (action != QAbstractSlider::SliderNoAction && action != QAbstractSlider::SliderMove) + { // we only want to save on mouseclicks or slider release (the other connect handles this) + Q_EMIT RequestSaveSliderPos(true); // actionTriggered happens before the value was changed + } + }); connect(m_modeActs, &QActionGroup::triggered, [=](QAction* act) { Q_EMIT RequestListModeActSet(act == m_modeActList.action); @@ -317,10 +324,10 @@ void game_list_frame::OnColClicked(int col) // Filter for Categories void game_list_frame::FilterData() { - for (int i = 0; i < gameList->rowCount(); ++i) + for (auto& game : m_game_data) { bool match = false; - const QString category = qstr(m_game_data[i].info.category); + const QString category = qstr(game.info.category); for (const auto& filter : m_categoryFilters) { if (category.contains(filter)) @@ -329,7 +336,7 @@ void game_list_frame::FilterData() break; } } - gameList->setRowHidden(i, !match || !SearchMatchesApp(m_game_data[i].info.name, m_game_data[i].info.serial)); + game.isVisible = match && SearchMatchesApp(game.info.name, game.info.serial); } } @@ -432,27 +439,17 @@ void game_list_frame::Refresh(bool fromDrive) // Load Image QImage img; - QPixmap pxmap; - if (!game.icon_path.empty() && img.load(qstr(game.icon_path))) + if (game.icon_path.empty() || !img.load(qstr(game.icon_path))) { - QImage scaled = QImage(m_Icon_Size, QImage::Format_ARGB32); - scaled.fill(m_Icon_Color); - QPainter painter(&scaled); - painter.drawImage(QPoint(0,0), img.scaled(m_Icon_Size, Qt::KeepAspectRatio, Qt::TransformationMode::SmoothTransformation)); - painter.end(); - pxmap = QPixmap::fromImage(scaled); - } - else - { - img = QImage(m_Icon_Size, QImage::Format_ARGB32); - QString abspath = QDir(qstr(game.icon_path)).absolutePath(); - LOG_ERROR(GENERAL, "Could not load image from path %s", sstr(abspath)); - img.fill(QColor(0, 0, 0, 0)); - pxmap = QPixmap::fromImage(img); + LOG_ERROR(GENERAL, "Could not load image from path %s", sstr(QDir(qstr(game.icon_path)).absolutePath())); } - m_game_data.push_back({ game, img, pxmap, bootable }); + bool hasCustomConfig = fs::is_file(fs::get_config_dir() + "data/" + game.serial + "/config.yml"); + + QPixmap pxmap = PaintedPixmap(img, hasCustomConfig); + + m_game_data.push_back({ game, img, pxmap, true, bootable, hasCustomConfig }); } auto op = [](const GUI_GameInfo& game1, const GUI_GameInfo& game2) { @@ -467,8 +464,8 @@ void game_list_frame::Refresh(bool fromDrive) if (m_isListLayout) { - int row = PopulateGameList(); FilterData(); + int row = PopulateGameList(); gameList->selectRow(row); SortGameList(); gameList->scrollTo(gameList->currentIndex(), QAbstractItemView::PositionAtCenter); @@ -628,6 +625,7 @@ void game_list_frame::ShowSpecifiedContextMenu(const QPoint &pos, int row) connect(boot, &QAction::triggered, [=]() {Boot(row); }); connect(configure, &QAction::triggered, [=]() { settings_dialog (xgui_settings, m_Render_Creator, 0, this, &currGame).exec(); + Refresh(true); }); connect(removeGame, &QAction::triggered, [=]() { @@ -638,7 +636,7 @@ void game_list_frame::ShowSpecifiedContextMenu(const QPoint &pos, int row) Refresh(); } }); - connect(removeConfig, &QAction::triggered, [=]() {RemoveCustomConfiguration(row); }); + connect(removeConfig, &QAction::triggered, [=]() {RemoveCustomConfiguration(row); Refresh(true); }); connect(openGameFolder, &QAction::triggered, [=]() {open_dir(currGame.path); }); connect(openConfig, &QAction::triggered, [=]() {open_dir(fs::get_config_dir() + "data/" + currGame.serial); }); connect(checkCompat, &QAction::triggered, [=]() { @@ -667,10 +665,7 @@ void game_list_frame::ShowSpecifiedContextMenu(const QPoint &pos, int row) } // Disable removeconfig if no config exists. - if (fs::is_file(fs::get_config_dir() + "data/" + currGame.serial + "/config.yml") == false) - { - removeConfig->setEnabled(false); - } + removeConfig->setEnabled(m_game_data[row].hasCustomConfig); myMenu.exec(globalPos); } @@ -720,6 +715,30 @@ void game_list_frame::RemoveCustomConfiguration(int row) } } +QPixmap game_list_frame::PaintedPixmap(const QImage& img, bool paintConfigIcon) +{ + QImage scaled = QImage(m_Icon_Size, QImage::Format_ARGB32); + scaled.fill(m_Icon_Color); + + QPainter painter(&scaled); + + if (!img.isNull()) + { + painter.drawImage(QPoint(0, 0), img.scaled(m_Icon_Size, Qt::KeepAspectRatio, Qt::TransformationMode::SmoothTransformation)); + } + + if (paintConfigIcon && !m_isListLayout) + { + int width = m_Icon_Size.width() * 0.2; + QPoint origin = QPoint(m_Icon_Size.width() - width, 0); + painter.drawImage(origin, QImage(":/Icons/cog_gray.png").scaled(QSize(width, width), Qt::KeepAspectRatio, Qt::TransformationMode::SmoothTransformation)); + } + + painter.end(); + + return QPixmap::fromImage(scaled); +} + void game_list_frame::ResizeIcons(const int& sliderPos) { m_icon_size_index = sliderPos; @@ -730,21 +749,19 @@ void game_list_frame::ResizeIcons(const int& sliderPos) m_Slider_Size->setSliderPosition(sliderPos); } - xgui_settings->SetValue(GUI::gl_iconSize, sliderPos); - - for (size_t i = 0; i < m_game_data.size(); i++) + for (auto& game : m_game_data) { - QImage scaled = QImage(m_Icon_Size, QImage::Format_ARGB32); - scaled.fill(m_Icon_Color); - QPainter painter(&scaled); - painter.drawImage(QPoint(0, 0), m_game_data[i].icon.scaled(m_Icon_Size, Qt::KeepAspectRatio, Qt::TransformationMode::SmoothTransformation)); - painter.end(); - m_game_data[i].pxmap = QPixmap::fromImage(scaled); + game.pxmap = PaintedPixmap(game.icon, game.hasCustomConfig); } Refresh(); } +int game_list_frame::GetSliderValue() +{ + return m_Slider_Size->value(); +} + void game_list_frame::SetListMode(const bool& isList) { m_oldLayoutIsList = m_isListLayout; @@ -756,7 +773,7 @@ void game_list_frame::SetListMode(const bool& isList) m_modeActList.action->setIcon(m_isListLayout ? m_modeActList.colored : m_modeActList.gray); m_modeActGrid.action->setIcon(m_isListLayout ? m_modeActGrid.gray : m_modeActGrid.colored); - Refresh(); + Refresh(true); m_Central_Widget->setCurrentWidget(m_isListLayout ? gameList : m_xgrid); } @@ -836,8 +853,7 @@ int game_list_frame::PopulateGameList() std::string selected_item = CurrentSelectionIconPath(); gameList->clearContents(); - - gameList->setRowCount(m_game_data.size()); + gameList->setRowCount((int)m_game_data.size()); auto l_GetItem = [](const std::string& text) { @@ -848,30 +864,43 @@ int game_list_frame::PopulateGameList() }; int row = 0; - for (const GUI_GameInfo& game : m_game_data) + for (size_t i = 0; i < m_game_data.size(); i++) { + if (!m_game_data[i].isVisible) + { + continue; + } + // Icon QTableWidgetItem* iconItem = new QTableWidgetItem; iconItem->setFlags(iconItem->flags() & ~Qt::ItemIsEditable); - iconItem->setData(Qt::DecorationRole, game.pxmap); - iconItem->setData(Qt::UserRole, row); + iconItem->setData(Qt::DecorationRole, m_game_data[i].pxmap); + iconItem->setData(Qt::UserRole, (int)i); + + QTableWidgetItem* titleItem = l_GetItem(m_game_data[i].info.name); + if (m_game_data[i].hasCustomConfig) + { + titleItem->setIcon(QIcon(":/Icons/cog_black.png")); + } + gameList->setItem(row, 0, iconItem); + gameList->setItem(row, 1, titleItem); + gameList->setItem(row, 2, l_GetItem(m_game_data[i].info.serial)); + gameList->setItem(row, 3, l_GetItem(m_game_data[i].info.fw)); + gameList->setItem(row, 4, l_GetItem(m_game_data[i].info.app_ver)); + gameList->setItem(row, 5, l_GetItem(m_game_data[i].info.category)); + gameList->setItem(row, 6, l_GetItem(m_game_data[i].info.path)); + gameList->setItem(row, 7, l_GetItem(GetStringFromU32(m_game_data[i].info.resolution, resolution::mode, true))); + gameList->setItem(row, 8, l_GetItem(GetStringFromU32(m_game_data[i].info.sound_format, sound::format, true))); + gameList->setItem(row, 9, l_GetItem(GetStringFromU32(m_game_data[i].info.parental_lvl, parental::level))); - gameList->setItem(row, 1, l_GetItem(game.info.name)); - gameList->setItem(row, 2, l_GetItem(game.info.serial)); - gameList->setItem(row, 3, l_GetItem(game.info.fw)); - gameList->setItem(row, 4, l_GetItem(game.info.app_ver)); - gameList->setItem(row, 5, l_GetItem(game.info.category)); - gameList->setItem(row, 6, l_GetItem(game.info.path)); - gameList->setItem(row, 7, l_GetItem(GetStringFromU32(game.info.resolution, resolution::mode, true))); - gameList->setItem(row, 8, l_GetItem(GetStringFromU32(game.info.sound_format, sound::format, true))); - gameList->setItem(row, 9, l_GetItem(GetStringFromU32(game.info.parental_lvl, parental::level))); - - if (selected_item == game.info.icon_path) result = row; + if (selected_item == m_game_data[i].info.icon_path) result = row; row++; } + gameList->setRowCount(row); + return result; } diff --git a/rpcs3/rpcs3qt/game_list_frame.h b/rpcs3/rpcs3qt/game_list_frame.h index bb5d40277d..f4e2167f20 100644 --- a/rpcs3/rpcs3qt/game_list_frame.h +++ b/rpcs3/rpcs3qt/game_list_frame.h @@ -149,15 +149,17 @@ namespace sound } /* Having the icons associated with the game info simplifies logic internally */ -typedef struct GUI_GameInfo +struct GUI_GameInfo { GameInfo info; QImage icon; QPixmap pxmap; + bool isVisible; bool bootable; + bool hasCustomConfig; }; -typedef struct Tool_Bar_Button +struct Tool_Bar_Button { QAction* action; QIcon colored; @@ -190,6 +192,8 @@ public: /** Resize Gamelist Icons to size given by slider position */ void ResizeIcons(const int& sliderPos); + int GetSliderValue(); + public Q_SLOTS: void SetListMode(const bool& isList); void SetToolBarVisible(const bool& showToolBar); @@ -211,11 +215,13 @@ Q_SIGNALS: void RequestIconSizeActSet(const int& idx); void RequestListModeActSet(const bool& isList); void RequestCategoryActSet(const int& id); + void RequestSaveSliderPos(const bool& save); protected: /** Override inherited method from Qt to allow signalling when close happened.*/ - void closeEvent(QCloseEvent* event); - void resizeEvent(QResizeEvent *event); + void closeEvent(QCloseEvent* event) override; + void resizeEvent(QResizeEvent *event) override; private: + QPixmap PaintedPixmap(const QImage& img, bool paintConfigIcon = false); void PopulateGameGrid(uint maxCols, const QSize& image_size, const QColor& image_color); void FilterData(); void SortGameList(); diff --git a/rpcs3/rpcs3qt/gl_gs_frame.cpp b/rpcs3/rpcs3qt/gl_gs_frame.cpp index 2ecccf23bc..db4302e627 100644 --- a/rpcs3/rpcs3qt/gl_gs_frame.cpp +++ b/rpcs3/rpcs3qt/gl_gs_frame.cpp @@ -5,8 +5,8 @@ #include #include -gl_gs_frame::gl_gs_frame(int w, int h, QIcon appIcon) - : gs_frame("OpenGL", w, h, appIcon) +gl_gs_frame::gl_gs_frame(int w, int h, QIcon appIcon, bool disableMouse) + : gs_frame("OpenGL", w, h, appIcon, disableMouse) { setSurfaceType(QSurface::OpenGLSurface); diff --git a/rpcs3/rpcs3qt/gl_gs_frame.h b/rpcs3/rpcs3qt/gl_gs_frame.h index 123c0d59a9..239225d04e 100644 --- a/rpcs3/rpcs3qt/gl_gs_frame.h +++ b/rpcs3/rpcs3qt/gl_gs_frame.h @@ -9,7 +9,7 @@ private: QSurfaceFormat m_format; public: - gl_gs_frame(int w, int h, QIcon appIcon); + gl_gs_frame(int w, int h, QIcon appIcon, bool disableMouse); void* make_context() override; void set_current(draw_context_t context) override; diff --git a/rpcs3/rpcs3qt/gs_frame.cpp b/rpcs3/rpcs3qt/gs_frame.cpp index 5b7f1078a3..af8ea6ca92 100644 --- a/rpcs3/rpcs3qt/gs_frame.cpp +++ b/rpcs3/rpcs3qt/gs_frame.cpp @@ -10,11 +10,9 @@ inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), _in.size()); } -gs_frame::gs_frame(const QString& title, int w, int h, QIcon appIcon) - : QWindow() +gs_frame::gs_frame(const QString& title, int w, int h, QIcon appIcon, bool disableMouse) + : QWindow(), m_windowTitle(title), m_disable_mouse(disableMouse) { - m_windowTitle = title; - if (!Emu.GetTitle().empty()) { m_windowTitle += qstr(" | " + Emu.GetTitle()); @@ -201,6 +199,8 @@ void gs_frame::flip(draw_context_t, bool /*skip_frame*/) void gs_frame::mouseDoubleClickEvent(QMouseEvent* ev) { + if (m_disable_mouse) return; + if (ev->button() == Qt::LeftButton) { OnFullScreen(); diff --git a/rpcs3/rpcs3qt/gs_frame.h b/rpcs3/rpcs3qt/gs_frame.h index da83298794..cbe36b0c74 100644 --- a/rpcs3/rpcs3qt/gs_frame.h +++ b/rpcs3/rpcs3qt/gs_frame.h @@ -12,13 +12,14 @@ class gs_frame : public QWindow, public GSFrameBase u64 m_frames = 0; QString m_windowTitle; bool m_show_fps; + bool m_disable_mouse; public: - gs_frame(const QString& title, int w, int h, QIcon appIcon); + gs_frame(const QString& title, int w, int h, QIcon appIcon, bool disableMouse); protected: virtual void paintEvent(QPaintEvent *event); - void keyPressEvent(QKeyEvent *keyEvent); + void keyPressEvent(QKeyEvent *keyEvent) override; void OnFullScreen(); void close() override; diff --git a/rpcs3/rpcs3qt/gui_settings.h b/rpcs3/rpcs3qt/gui_settings.h index 5ff1ece1f6..d6376d8ef9 100644 --- a/rpcs3/rpcs3qt/gui_settings.h +++ b/rpcs3/rpcs3qt/gui_settings.h @@ -113,9 +113,10 @@ namespace GUI const GUI_SAVE m_saveNotes = GUI_SAVE(meta, "saveNotes", QVariantMap()); const GUI_SAVE m_showDebugTab = GUI_SAVE(meta, "showDebugTab", false); - const GUI_SAVE gs_resize = GUI_SAVE(gs_frame, "resize", false); - const GUI_SAVE gs_width = GUI_SAVE(gs_frame, "width", 1280); - const GUI_SAVE gs_height = GUI_SAVE(gs_frame, "height", 720); + const GUI_SAVE gs_disableMouse = GUI_SAVE(gs_frame, "disableMouse", false); + const GUI_SAVE gs_resize = GUI_SAVE(gs_frame, "resize", false); + const GUI_SAVE gs_width = GUI_SAVE(gs_frame, "width", 1280); + const GUI_SAVE gs_height = GUI_SAVE(gs_frame, "height", 720); } /** Class for GUI settings.. diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index e7c4817f3c..8078dc7bb3 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -812,7 +812,7 @@ void main_window::BootRecentAction(const QAction* act) } // path is invalid: remove action from list return - if (containsPath && nam.isEmpty() || !QFileInfo(pth).isDir() && !QFileInfo(pth).isFile()) + if ((containsPath && nam.isEmpty()) || (!QFileInfo(pth).isDir() && !QFileInfo(pth).isFile())) { if (containsPath) { @@ -867,7 +867,7 @@ void main_window::BootRecentAction(const QAction* act) QAction* main_window::CreateRecentAction(const q_string_pair& entry, const uint& sc_idx) { // if path is not valid remove from list - if (entry.second.isEmpty() || !QFileInfo(entry.first).isDir() && !QFileInfo(entry.first).isFile()) + if (entry.second.isEmpty() || (!QFileInfo(entry.first).isDir() && !QFileInfo(entry.first).isFile())) { if (m_rg_entries.contains(entry)) { @@ -1147,11 +1147,20 @@ void main_window::CreateConnects() }); connect(ui->aboutQtAct, &QAction::triggered, qApp, &QApplication::aboutQt); auto resizeIcons = [=](const int& index){ - if (ui->sizeSlider->value() != index) + int val = ui->sizeSlider->value(); + if (val != index) { ui->sizeSlider->setSliderPosition(index); } - gameListFrame->ResizeIcons(index); + if (val != gameListFrame->GetSliderValue()) + { + if (m_save_slider_pos) + { + m_save_slider_pos = false; + guiSettings->SetValue(GUI::gl_iconSize, index); + } + gameListFrame->ResizeIcons(index); + } }; connect(iconSizeActGroup, &QActionGroup::triggered, [=](QAction* act) { @@ -1175,6 +1184,7 @@ void main_window::CreateConnects() resizeIcons(idx); }); + connect(gameListFrame, &game_list_frame::RequestSaveSliderPos, [=](const bool& save){ m_save_slider_pos = true; }); connect(gameListFrame, &game_list_frame::RequestListModeActSet, [=](const bool& isList) { isList ? ui->setlistModeListAct->trigger() : ui->setlistModeGridAct->trigger(); @@ -1212,6 +1222,13 @@ void main_window::CreateConnects() connect(ui->toolbar_grid, &QAction::triggered, [=]() { ui->setlistModeGridAct->trigger(); }); //connect(ui->toolbar_sort, &QAction::triggered, gameListFrame, sort); connect(ui->sizeSlider, &QSlider::valueChanged, resizeIcons); + connect(ui->sizeSlider, &QSlider::sliderReleased, this, [&] { guiSettings->SetValue(GUI::gl_iconSize, ui->sizeSlider->value()); }); + connect(ui->sizeSlider, &QSlider::actionTriggered, [&](int action) { + if (action != QAbstractSlider::SliderNoAction && action != QAbstractSlider::SliderMove) + { // we only want to save on mouseclicks or slider release (the other connect handles this) + m_save_slider_pos = true; // actionTriggered happens before the value was changed + } + }); connect(ui->searchBar, &QLineEdit::textChanged, gameListFrame, &game_list_frame::SetSearchText); } @@ -1359,7 +1376,7 @@ void main_window::ConfigureGuiFromSettings(bool configureAll) void main_window::keyPressEvent(QKeyEvent *keyEvent) { - if ((keyEvent->modifiers() & Qt::AltModifier) && keyEvent->key() == Qt::Key_Return || isFullScreen() && keyEvent->key() == Qt::Key_Escape) + if (((keyEvent->modifiers() & Qt::AltModifier) && keyEvent->key() == Qt::Key_Return) || (isFullScreen() && keyEvent->key() == Qt::Key_Escape)) { ui->toolbar_fullscreen->trigger(); } diff --git a/rpcs3/rpcs3qt/main_window.h b/rpcs3/rpcs3qt/main_window.h index f1e95c0a06..2e861e2912 100644 --- a/rpcs3/rpcs3qt/main_window.h +++ b/rpcs3/rpcs3qt/main_window.h @@ -29,6 +29,7 @@ class main_window : public QMainWindow Ui::main_window *ui; bool m_sys_menu_opened; + bool m_save_slider_pos = false; Render_Creator m_Render_Creator; @@ -92,8 +93,8 @@ private: void ConfigureGuiFromSettings(bool configureAll = false); void EnableMenus(bool enabled); - void keyPressEvent(QKeyEvent *keyEvent); - void mouseDoubleClickEvent(QMouseEvent *event); + void keyPressEvent(QKeyEvent *keyEvent) override; + void mouseDoubleClickEvent(QMouseEvent *event) override; QAction* CreateRecentAction(const q_string_pair& entry, const uint& sc_idx); void BootRecentAction(const QAction* act); diff --git a/rpcs3/rpcs3qt/pad_settings_dialog.h b/rpcs3/rpcs3qt/pad_settings_dialog.h index 337deb79e3..a8fcdc631e 100644 --- a/rpcs3/rpcs3qt/pad_settings_dialog.h +++ b/rpcs3/rpcs3qt/pad_settings_dialog.h @@ -71,7 +71,7 @@ public: virtual void Init(const u32 max_connect) override; explicit pad_settings_dialog(QWidget *parent = 0); ~pad_settings_dialog(); - void keyPressEvent(QKeyEvent *keyEvent); + void keyPressEvent(QKeyEvent *keyEvent) override; void UpdateLabel(); void UpdateTimerLabel(const u32 id); void SwitchButtons(const bool IsEnabled); diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index e353de9070..bfb1415690 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -677,6 +677,8 @@ settings_dialog::settings_dialog(std::shared_ptr xSettings, const ui->gs_resizeOnBoot->setToolTip(json_emu_misc["gs_resizeOnBoot"].toString()); + ui->gs_disableMouse->setToolTip(json_emu_misc["gs_disableMouse"].toString()); + ui->cb_show_welcome->setToolTip(json_emu_gui["show_welcome"].toString()); xemu_settings->EnhanceCheckBox(ui->exitOnStop, emu_settings::ExitRPCS3OnFinish); @@ -779,6 +781,9 @@ settings_dialog::settings_dialog(std::shared_ptr xSettings, const addColoredIcon(ui->pb_gl_tool_icon_color, xgui_settings->GetValue(GUI::gl_toolIconColor).value(), QIcon(":/Icons/home_blue.png"), GUI::gl_tool_icon_color); addColoredIcon(ui->pb_tool_icon_color, xgui_settings->GetValue(GUI::mw_toolIconColor).value(), QIcon(":/Icons/stop.png"), GUI::mw_tool_icon_color); + ui->gs_disableMouse->setChecked(xgui_settings->GetValue(GUI::gs_disableMouse).toBool()); + connect(ui->gs_disableMouse, &QCheckBox::clicked, [=](bool val) { xgui_settings->SetValue(GUI::gs_disableMouse, val); }); + bool enableButtons = xgui_settings->GetValue(GUI::gs_resize).toBool(); ui->gs_resizeOnBoot->setChecked(enableButtons); ui->gs_width->setEnabled(enableButtons); @@ -960,7 +965,6 @@ void settings_dialog::OnApplyStylesheet() int settings_dialog::exec() { - show(); for (int i = 0; i < ui->tabWidget->count(); i++) { ui->tabWidget->setCurrentIndex(i); diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index 3418cf6fa6..367218bb90 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -36,7 +36,7 @@ - 1 + 0 @@ -1102,6 +1102,13 @@ Viewport + + + + Don't use doubleclick for Fullscreen mode + + +