summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorgerman <german@thesoftwareartisans.com>2020-12-09 19:53:43 +0100
committergerman <german@thesoftwareartisans.com>2020-12-23 00:06:48 +0100
commit64fad8cfe94b506b9450893864bcc46509f55bba (patch)
treee5d1310ef69bf0a5bae8d132d3561d34d6c68b7e /src
parentMerge pull request #5042 from Morph1984/project-aether (diff)
downloadyuzu-64fad8cfe94b506b9450893864bcc46509f55bba.tar
yuzu-64fad8cfe94b506b9450893864bcc46509f55bba.tar.gz
yuzu-64fad8cfe94b506b9450893864bcc46509f55bba.tar.bz2
yuzu-64fad8cfe94b506b9450893864bcc46509f55bba.tar.lz
yuzu-64fad8cfe94b506b9450893864bcc46509f55bba.tar.xz
yuzu-64fad8cfe94b506b9450893864bcc46509f55bba.tar.zst
yuzu-64fad8cfe94b506b9450893864bcc46509f55bba.zip
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/main.cpp21
-rw-r--r--src/yuzu/main.h3
-rw-r--r--src/yuzu/main.ui12
3 files changed, 30 insertions, 6 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 620e80cdc..1b12fa735 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -939,7 +939,10 @@ void GMainWindow::ConnectMenuEvents() {
&GMainWindow::OnDisplayTitleBars);
connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar);
connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible);
- connect(ui.action_Reset_Window_Size, &QAction::triggered, this, &GMainWindow::ResetWindowSize);
+ connect(ui.action_Reset_Window_Size_720, &QAction::triggered, this,
+ &GMainWindow::ResetWindowSize720);
+ connect(ui.action_Reset_Window_Size_1080, &QAction::triggered, this,
+ &GMainWindow::ResetWindowSize1080);
// Fullscreen
connect(ui.action_Fullscreen, &QAction::triggered, this, &GMainWindow::ToggleFullscreen);
@@ -2258,7 +2261,7 @@ void GMainWindow::ToggleWindowMode() {
}
}
-void GMainWindow::ResetWindowSize() {
+void GMainWindow::ResetWindowSize720() {
const auto aspect_ratio = Layout::EmulationAspectRatio(
static_cast<Layout::AspectRatio>(Settings::values.aspect_ratio.GetValue()),
static_cast<float>(Layout::ScreenUndocked::Height) / Layout::ScreenUndocked::Width);
@@ -2272,6 +2275,20 @@ void GMainWindow::ResetWindowSize() {
}
}
+void GMainWindow::ResetWindowSize1080() {
+ const auto aspect_ratio = Layout::EmulationAspectRatio(
+ static_cast<Layout::AspectRatio>(Settings::values.aspect_ratio.GetValue()),
+ static_cast<float>(Layout::ScreenDocked::Height) / Layout::ScreenDocked::Width);
+ if (!ui.action_Single_Window_Mode->isChecked()) {
+ render_window->resize(Layout::ScreenDocked::Height / aspect_ratio,
+ Layout::ScreenDocked::Height);
+ } else {
+ resize(Layout::ScreenDocked::Height / aspect_ratio,
+ Layout::ScreenDocked::Height + menuBar()->height() +
+ (ui.action_Show_Status_Bar->isChecked() ? statusBar()->height() : 0));
+ }
+}
+
void GMainWindow::OnConfigure() {
const auto old_theme = UISettings::values.theme;
const bool old_discord_presence = UISettings::values.enable_discord_presence;
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index 22f82b20e..8b6b85800 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -242,7 +242,8 @@ private slots:
void ShowFullscreen();
void HideFullscreen();
void ToggleWindowMode();
- void ResetWindowSize();
+ void ResetWindowSize720();
+ void ResetWindowSize1080();
void OnCaptureScreenshot();
void OnCoreError(Core::System::ResultStatus, std::string);
void OnReinitializeKeys(ReinitializeKeyBehavior behavior);
diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui
index 2f3792247..e266a5c0a 100644
--- a/src/yuzu/main.ui
+++ b/src/yuzu/main.ui
@@ -97,7 +97,8 @@
<addaction name="action_Display_Dock_Widget_Headers"/>
<addaction name="action_Show_Filter_Bar"/>
<addaction name="action_Show_Status_Bar"/>
- <addaction name="action_Reset_Window_Size"/>
+ <addaction name="action_Reset_Window_Size_720"/>
+ <addaction name="action_Reset_Window_Size_1080"/>
<addaction name="separator"/>
<addaction name="menu_View_Debugging"/>
</widget>
@@ -220,9 +221,14 @@
<string>Show Status Bar</string>
</property>
</action>
- <action name="action_Reset_Window_Size">
+ <action name="action_Reset_Window_Size_720">
<property name="text">
- <string>Reset Window Size</string>
+ <string>Reset Window Size to 720p</string>
+ </property>
+ </action>
+ <action name="action_Reset_Window_Size_1080">
+ <property name="text">
+ <string>Reset Window Size to 1080p</string>
</property>
</action>
<action name="action_Fullscreen">