diff options
| author | 2020-05-15 16:22:27 -0400 | |
|---|---|---|
| committer | 2020-05-15 22:22:27 +0200 | |
| commit | b73f678ee82a6f3fae36ed39dfc4cfc27c64a871 (patch) | |
| tree | c87d2dc03d7ef150c49f694af33b1ad1c6f1ea7f | |
| parent | Merge pull request #3927 from jroweboy/fix-bug (diff) | |
| download | yuzu-b73f678ee82a6f3fae36ed39dfc4cfc27c64a871.tar.gz yuzu-b73f678ee82a6f3fae36ed39dfc4cfc27c64a871.tar.xz yuzu-b73f678ee82a6f3fae36ed39dfc4cfc27c64a871.zip | |
frontend: Set minimum window size to 640x360 instead of 1280x720 (#3413)
Diffstat (limited to '')
| -rw-r--r-- | src/core/frontend/emu_window.cpp | 2 | ||||
| -rw-r--r-- | src/core/frontend/framebuffer_layout.h | 5 | ||||
| -rw-r--r-- | src/yuzu/loading_screen.cpp | 3 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 21 | ||||
| -rw-r--r-- | src/yuzu/main.h | 1 | ||||
| -rw-r--r-- | src/yuzu/main.ui | 12 |
6 files changed, 36 insertions, 8 deletions
diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp index eda466a5d..9a081fbd4 100644 --- a/src/core/frontend/emu_window.cpp +++ b/src/core/frontend/emu_window.cpp | |||
| @@ -46,7 +46,7 @@ private: | |||
| 46 | EmuWindow::EmuWindow() { | 46 | EmuWindow::EmuWindow() { |
| 47 | // TODO: Find a better place to set this. | 47 | // TODO: Find a better place to set this. |
| 48 | config.min_client_area_size = | 48 | config.min_client_area_size = |
| 49 | std::make_pair(Layout::ScreenUndocked::Width, Layout::ScreenUndocked::Height); | 49 | std::make_pair(Layout::MinimumSize::Width, Layout::MinimumSize::Height); |
| 50 | active_config = config; | 50 | active_config = config; |
| 51 | touch_state = std::make_shared<TouchState>(); | 51 | touch_state = std::make_shared<TouchState>(); |
| 52 | Input::RegisterFactory<Input::TouchDevice>("emu_window", touch_state); | 52 | Input::RegisterFactory<Input::TouchDevice>("emu_window", touch_state); |
diff --git a/src/core/frontend/framebuffer_layout.h b/src/core/frontend/framebuffer_layout.h index 15ecfb13d..91ecc30ab 100644 --- a/src/core/frontend/framebuffer_layout.h +++ b/src/core/frontend/framebuffer_layout.h | |||
| @@ -8,6 +8,11 @@ | |||
| 8 | 8 | ||
| 9 | namespace Layout { | 9 | namespace Layout { |
| 10 | 10 | ||
| 11 | namespace MinimumSize { | ||
| 12 | constexpr u32 Width = 640; | ||
| 13 | constexpr u32 Height = 360; | ||
| 14 | } // namespace MinimumSize | ||
| 15 | |||
| 11 | namespace ScreenUndocked { | 16 | namespace ScreenUndocked { |
| 12 | constexpr u32 Width = 1280; | 17 | constexpr u32 Width = 1280; |
| 13 | constexpr u32 Height = 720; | 18 | constexpr u32 Height = 720; |
diff --git a/src/yuzu/loading_screen.cpp b/src/yuzu/loading_screen.cpp index 2a6483370..ae842306c 100644 --- a/src/yuzu/loading_screen.cpp +++ b/src/yuzu/loading_screen.cpp | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <QTime> | 19 | #include <QTime> |
| 20 | #include <QtConcurrent/QtConcurrentRun> | 20 | #include <QtConcurrent/QtConcurrentRun> |
| 21 | #include "common/logging/log.h" | 21 | #include "common/logging/log.h" |
| 22 | #include "core/frontend/framebuffer_layout.h" | ||
| 22 | #include "core/loader/loader.h" | 23 | #include "core/loader/loader.h" |
| 23 | #include "ui_loading_screen.h" | 24 | #include "ui_loading_screen.h" |
| 24 | #include "video_core/rasterizer_interface.h" | 25 | #include "video_core/rasterizer_interface.h" |
| @@ -61,7 +62,7 @@ LoadingScreen::LoadingScreen(QWidget* parent) | |||
| 61 | : QWidget(parent), ui(std::make_unique<Ui::LoadingScreen>()), | 62 | : QWidget(parent), ui(std::make_unique<Ui::LoadingScreen>()), |
| 62 | previous_stage(VideoCore::LoadCallbackStage::Complete) { | 63 | previous_stage(VideoCore::LoadCallbackStage::Complete) { |
| 63 | ui->setupUi(this); | 64 | ui->setupUi(this); |
| 64 | setMinimumSize(1280, 720); | 65 | setMinimumSize(Layout::MinimumSize::Width, Layout::MinimumSize::Height); |
| 65 | 66 | ||
| 66 | // Create a fade out effect to hide this loading screen widget. | 67 | // Create a fade out effect to hide this loading screen widget. |
| 67 | // When fading opacity, it will fade to the parent widgets background color, which is why we | 68 | // When fading opacity, it will fade to the parent widgets background color, which is why we |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 86e8a1d49..dd6e5173e 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -724,13 +724,13 @@ void GMainWindow::InitializeHotkeys() { | |||
| 724 | } | 724 | } |
| 725 | 725 | ||
| 726 | void GMainWindow::SetDefaultUIGeometry() { | 726 | void GMainWindow::SetDefaultUIGeometry() { |
| 727 | // geometry: 55% of the window contents are in the upper screen half, 45% in the lower half | 727 | // geometry: 53% of the window contents are in the upper screen half, 47% in the lower half |
| 728 | const QRect screenRect = QApplication::desktop()->screenGeometry(this); | 728 | const QRect screenRect = QApplication::desktop()->screenGeometry(this); |
| 729 | 729 | ||
| 730 | const int w = screenRect.width() * 2 / 3; | 730 | const int w = screenRect.width() * 2 / 3; |
| 731 | const int h = screenRect.height() / 2; | 731 | const int h = screenRect.height() * 2 / 3; |
| 732 | const int x = (screenRect.x() + screenRect.width()) / 2 - w / 2; | 732 | const int x = (screenRect.x() + screenRect.width()) / 2 - w / 2; |
| 733 | const int y = (screenRect.y() + screenRect.height()) / 2 - h * 55 / 100; | 733 | const int y = (screenRect.y() + screenRect.height()) / 2 - h * 53 / 100; |
| 734 | 734 | ||
| 735 | setGeometry(x, y, w, h); | 735 | setGeometry(x, y, w, h); |
| 736 | } | 736 | } |
| @@ -831,6 +831,7 @@ void GMainWindow::ConnectMenuEvents() { | |||
| 831 | &GMainWindow::OnDisplayTitleBars); | 831 | &GMainWindow::OnDisplayTitleBars); |
| 832 | connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar); | 832 | connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar); |
| 833 | connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); | 833 | connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); |
| 834 | connect(ui.action_Reset_Window_Size, &QAction::triggered, this, &GMainWindow::ResetWindowSize); | ||
| 834 | 835 | ||
| 835 | // Fullscreen | 836 | // Fullscreen |
| 836 | ui.action_Fullscreen->setShortcut( | 837 | ui.action_Fullscreen->setShortcut( |
| @@ -1829,6 +1830,20 @@ void GMainWindow::ToggleWindowMode() { | |||
| 1829 | } | 1830 | } |
| 1830 | } | 1831 | } |
| 1831 | 1832 | ||
| 1833 | void GMainWindow::ResetWindowSize() { | ||
| 1834 | const auto aspect_ratio = Layout::EmulationAspectRatio( | ||
| 1835 | static_cast<Layout::AspectRatio>(Settings::values.aspect_ratio), | ||
| 1836 | static_cast<float>(Layout::ScreenUndocked::Height) / Layout::ScreenUndocked::Width); | ||
| 1837 | if (!ui.action_Single_Window_Mode->isChecked()) { | ||
| 1838 | render_window->resize(Layout::ScreenUndocked::Height / aspect_ratio, | ||
| 1839 | Layout::ScreenUndocked::Height); | ||
| 1840 | } else { | ||
| 1841 | resize(Layout::ScreenUndocked::Height / aspect_ratio, | ||
| 1842 | Layout::ScreenUndocked::Height + menuBar()->height() + | ||
| 1843 | (ui.action_Show_Status_Bar->isChecked() ? statusBar()->height() : 0)); | ||
| 1844 | } | ||
| 1845 | } | ||
| 1846 | |||
| 1832 | void GMainWindow::OnConfigure() { | 1847 | void GMainWindow::OnConfigure() { |
| 1833 | const auto old_theme = UISettings::values.theme; | 1848 | const auto old_theme = UISettings::values.theme; |
| 1834 | const bool old_discord_presence = UISettings::values.enable_discord_presence; | 1849 | const bool old_discord_presence = UISettings::values.enable_discord_presence; |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 60b17c54a..4bff4330c 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -208,6 +208,7 @@ private slots: | |||
| 208 | void ShowFullscreen(); | 208 | void ShowFullscreen(); |
| 209 | void HideFullscreen(); | 209 | void HideFullscreen(); |
| 210 | void ToggleWindowMode(); | 210 | void ToggleWindowMode(); |
| 211 | void ResetWindowSize(); | ||
| 211 | void OnCaptureScreenshot(); | 212 | void OnCaptureScreenshot(); |
| 212 | void OnCoreError(Core::System::ResultStatus, std::string); | 213 | void OnCoreError(Core::System::ResultStatus, std::string); |
| 213 | void OnReinitializeKeys(ReinitializeKeyBehavior behavior); | 214 | void OnReinitializeKeys(ReinitializeKeyBehavior behavior); |
diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui index ae414241e..97c90f50b 100644 --- a/src/yuzu/main.ui +++ b/src/yuzu/main.ui | |||
| @@ -6,8 +6,8 @@ | |||
| 6 | <rect> | 6 | <rect> |
| 7 | <x>0</x> | 7 | <x>0</x> |
| 8 | <y>0</y> | 8 | <y>0</y> |
| 9 | <width>1081</width> | 9 | <width>1280</width> |
| 10 | <height>730</height> | 10 | <height>720</height> |
| 11 | </rect> | 11 | </rect> |
| 12 | </property> | 12 | </property> |
| 13 | <property name="windowTitle"> | 13 | <property name="windowTitle"> |
| @@ -44,7 +44,7 @@ | |||
| 44 | <rect> | 44 | <rect> |
| 45 | <x>0</x> | 45 | <x>0</x> |
| 46 | <y>0</y> | 46 | <y>0</y> |
| 47 | <width>1081</width> | 47 | <width>1280</width> |
| 48 | <height>21</height> | 48 | <height>21</height> |
| 49 | </rect> | 49 | </rect> |
| 50 | </property> | 50 | </property> |
| @@ -96,6 +96,7 @@ | |||
| 96 | <addaction name="action_Display_Dock_Widget_Headers"/> | 96 | <addaction name="action_Display_Dock_Widget_Headers"/> |
| 97 | <addaction name="action_Show_Filter_Bar"/> | 97 | <addaction name="action_Show_Filter_Bar"/> |
| 98 | <addaction name="action_Show_Status_Bar"/> | 98 | <addaction name="action_Show_Status_Bar"/> |
| 99 | <addaction name="action_Reset_Window_Size"/> | ||
| 99 | <addaction name="separator"/> | 100 | <addaction name="separator"/> |
| 100 | <addaction name="menu_View_Debugging"/> | 101 | <addaction name="menu_View_Debugging"/> |
| 101 | </widget> | 102 | </widget> |
| @@ -215,6 +216,11 @@ | |||
| 215 | <string>Show Status Bar</string> | 216 | <string>Show Status Bar</string> |
| 216 | </property> | 217 | </property> |
| 217 | </action> | 218 | </action> |
| 219 | <action name="action_Reset_Window_Size"> | ||
| 220 | <property name="text"> | ||
| 221 | <string>Reset Window Size</string> | ||
| 222 | </property> | ||
| 223 | </action> | ||
| 218 | <action name="action_Fullscreen"> | 224 | <action name="action_Fullscreen"> |
| 219 | <property name="checkable"> | 225 | <property name="checkable"> |
| 220 | <bool>true</bool> | 226 | <bool>true</bool> |