From 035a39a9a8d339b5fa63d9cb98c522b773425adc Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sat, 15 Jul 2017 20:22:24 +0200 Subject: [PATCH] GUI: minor figgcess (#3010) * emulator tab: minor layout adjustment * tool bar: adjust size dynamically for hidpi * gamelist tool bar: adjust size dynamically for hidpi * gamelist search bar: adjust style * move game_list.h into rpcs3qt * hide game data by default --- rpcs3/rpcs3.vcxproj | 2 +- rpcs3/rpcs3.vcxproj.filters | 2 +- rpcs3/{ => rpcs3qt}/game_list.h | 0 rpcs3/rpcs3qt/game_list_frame.cpp | 5 +- rpcs3/rpcs3qt/gui_settings.h | 2 +- rpcs3/rpcs3qt/main_window.cpp | 7 ++ rpcs3/rpcs3qt/main_window.ui | 2 +- rpcs3/rpcs3qt/settings_dialog.ui | 195 +++++++++++++++++------------- 8 files changed, 128 insertions(+), 87 deletions(-) rename rpcs3/{ => rpcs3qt}/game_list.h (100%) diff --git a/rpcs3/rpcs3.vcxproj b/rpcs3/rpcs3.vcxproj index 3e99f4a358..3b73722692 100644 --- a/rpcs3/rpcs3.vcxproj +++ b/rpcs3/rpcs3.vcxproj @@ -924,7 +924,6 @@ $(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath) - Moc%27ing gs_frame.h... @@ -1202,6 +1201,7 @@ .\QTGeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\QTGeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_WINEXTRAS_LIB -DLLVM_AVAILABLE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE "-I.\..\Vulkan\Vulkan-LoaderAndValidationLayers\include" "-I.\.." "-I.\..\3rdparty\minidx12\Include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtQuick" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtQml" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtCore" "-I.\debug" "-I$(QTDIR)\mkspecs\win32-msvc2015" "-I.\QTGeneratedFiles\$(ConfigurationName)\." "-I.\QTGeneratedFiles" "-I$(QTDIR)\include\QtWinExtras" + diff --git a/rpcs3/rpcs3.vcxproj.filters b/rpcs3/rpcs3.vcxproj.filters index f803443027..25341f839d 100644 --- a/rpcs3/rpcs3.vcxproj.filters +++ b/rpcs3/rpcs3.vcxproj.filters @@ -514,7 +514,7 @@ Generated Files - + Gui diff --git a/rpcs3/game_list.h b/rpcs3/rpcs3qt/game_list.h similarity index 100% rename from rpcs3/game_list.h rename to rpcs3/rpcs3qt/game_list.h diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index c66d60d96f..9b2780893e 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -113,6 +113,9 @@ game_list_frame::game_list_frame(std::shared_ptr settings, const R // Search Bar m_Search_Bar = new QLineEdit(m_Tool_Bar); m_Search_Bar->setPlaceholderText(tr("Search games ...")); + m_Search_Bar->setMinimumWidth(m_Tool_Bar->height() * 5); + m_Search_Bar->setFrame(false); + m_Search_Bar->setStyleSheet("background:transparent;"); connect(m_Search_Bar, &QLineEdit::textChanged, [this](const QString& text) { m_searchText = text; Refresh(); @@ -122,7 +125,7 @@ game_list_frame::game_list_frame(std::shared_ptr settings, const R m_Slider_Size = new QSlider(Qt::Horizontal , m_Tool_Bar); m_Slider_Size->setRange(0, GUI::gl_icon_size.size() - 1); m_Slider_Size->setSliderPosition(icon_size_index); - m_Slider_Size->setFixedWidth(100); + m_Slider_Size->setFixedWidth(m_Tool_Bar->height() * 3); m_Tool_Bar->addWidget(m_Search_Bar); m_Tool_Bar->addWidget(new QLabel(" ")); diff --git a/rpcs3/rpcs3qt/gui_settings.h b/rpcs3/rpcs3qt/gui_settings.h index e0e5eebdcf..6ecc834dd5 100644 --- a/rpcs3/rpcs3qt/gui_settings.h +++ b/rpcs3/rpcs3qt/gui_settings.h @@ -87,7 +87,7 @@ namespace GUI const GUI_SAVE cat_disc_game = GUI_SAVE( game_list, "categoryVisibleDiscGame", true ); const GUI_SAVE cat_home = GUI_SAVE( game_list, "categoryVisibleHome", true ); const GUI_SAVE cat_audio_video = GUI_SAVE( game_list, "categoryVisibleAudioVideo", true ); - const GUI_SAVE cat_game_data = GUI_SAVE( game_list, "categoryVisibleGameData", true ); + const GUI_SAVE cat_game_data = GUI_SAVE( game_list, "categoryVisibleGameData", false ); const GUI_SAVE cat_unknown = GUI_SAVE( game_list, "categoryVisibleUnknown", true ); const GUI_SAVE cat_other = GUI_SAVE( game_list, "categoryVisibleOther", true ); diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index 89bbea7774..c43985408a 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -91,6 +91,13 @@ void main_window::Init() ui->toolBar->addSeparator(); ui->toolBar->addWidget(ui->searchBar); + // for highdpi resize toolbar icons and height dynamically + // choose factors to mimic Gui-Design in main_window.ui + const int toolBarHeight = menuBar()->sizeHint().height() * 2; + ui->toolBar->setIconSize(QSize(toolBarHeight, toolBarHeight)); + ui->sizeSliderContainer->setFixedWidth(toolBarHeight * 5); + ui->sizeSlider->setFixedHeight(toolBarHeight * 0.625f); + CreateActions(); CreateDockWindows(); diff --git a/rpcs3/rpcs3qt/main_window.ui b/rpcs3/rpcs3qt/main_window.ui index 62f85f9471..de4c2711d3 100644 --- a/rpcs3/rpcs3qt/main_window.ui +++ b/rpcs3/rpcs3qt/main_window.ui @@ -117,7 +117,7 @@ margin-left:14px; - + 0 0 diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index fb878295b5..f1f4695c7f 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -36,7 +36,7 @@ - 6 + 0 @@ -1023,7 +1023,7 @@ Emulator - + @@ -1147,86 +1147,120 @@ - - - Viewport - - + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + - - - Resize game window on boot + + + Viewport + + + + + Resize game window on boot + + + + + + + + + Width + + + + + + true + + + QAbstractSpinBox::CorrectToNearestValue + + + false + + + 0 + + + 9999 + + + 0 + + + + + + + + + + Heigth + + + + + + true + + + true + + + QAbstractSpinBox::CorrectToNearestValue + + + false + + + 0 + + + 9999 + + + 0 + + + + + + + + + - - - - - Width - - - - - - true - - - QAbstractSpinBox::CorrectToNearestValue - - - false - - - 0 - - - 9999 - - - 0 - - - - - - - - - - Heigth - - - - - - true - - - true - - - QAbstractSpinBox::CorrectToNearestValue - - - false - - - 0 - - - 9999 - - - 0 - - - - - - - + + + Qt::Vertical + + + + 20 + 29 + + + @@ -1275,12 +1309,9 @@ Qt::Vertical - - QSizePolicy::MinimumExpanding - - 20 + 0 0 @@ -1353,7 +1384,7 @@ - +