summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2020-12-22 16:06:20 -0800
committerGravatar GitHub2020-12-22 16:06:20 -0800
commitd7f5e55f8ed30e2bb5dcb2844287a6db83f8d935 (patch)
treee5d1310ef69bf0a5bae8d132d3561d34d6c68b7e
parentMerge pull request #5042 from Morph1984/project-aether (diff)
parentAdd option to reset window size to 1080p (diff)
downloadyuzu-d7f5e55f8ed30e2bb5dcb2844287a6db83f8d935.tar.gz
yuzu-d7f5e55f8ed30e2bb5dcb2844287a6db83f8d935.tar.xz
yuzu-d7f5e55f8ed30e2bb5dcb2844287a6db83f8d935.zip
Merge pull request #5178 from german77/dockedresize
Add option to reset window size to 1080p
Diffstat (limited to '')
-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() {
939 &GMainWindow::OnDisplayTitleBars); 939 &GMainWindow::OnDisplayTitleBars);
940 connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar); 940 connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar);
941 connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); 941 connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible);
942 connect(ui.action_Reset_Window_Size, &QAction::triggered, this, &GMainWindow::ResetWindowSize); 942 connect(ui.action_Reset_Window_Size_720, &QAction::triggered, this,
943 &GMainWindow::ResetWindowSize720);
944 connect(ui.action_Reset_Window_Size_1080, &QAction::triggered, this,
945 &GMainWindow::ResetWindowSize1080);
943 946
944 // Fullscreen 947 // Fullscreen
945 connect(ui.action_Fullscreen, &QAction::triggered, this, &GMainWindow::ToggleFullscreen); 948 connect(ui.action_Fullscreen, &QAction::triggered, this, &GMainWindow::ToggleFullscreen);
@@ -2258,7 +2261,7 @@ void GMainWindow::ToggleWindowMode() {
2258 } 2261 }
2259} 2262}
2260 2263
2261void GMainWindow::ResetWindowSize() { 2264void GMainWindow::ResetWindowSize720() {
2262 const auto aspect_ratio = Layout::EmulationAspectRatio( 2265 const auto aspect_ratio = Layout::EmulationAspectRatio(
2263 static_cast<Layout::AspectRatio>(Settings::values.aspect_ratio.GetValue()), 2266 static_cast<Layout::AspectRatio>(Settings::values.aspect_ratio.GetValue()),
2264 static_cast<float>(Layout::ScreenUndocked::Height) / Layout::ScreenUndocked::Width); 2267 static_cast<float>(Layout::ScreenUndocked::Height) / Layout::ScreenUndocked::Width);
@@ -2272,6 +2275,20 @@ void GMainWindow::ResetWindowSize() {
2272 } 2275 }
2273} 2276}
2274 2277
2278void GMainWindow::ResetWindowSize1080() {
2279 const auto aspect_ratio = Layout::EmulationAspectRatio(
2280 static_cast<Layout::AspectRatio>(Settings::values.aspect_ratio.GetValue()),
2281 static_cast<float>(Layout::ScreenDocked::Height) / Layout::ScreenDocked::Width);
2282 if (!ui.action_Single_Window_Mode->isChecked()) {
2283 render_window->resize(Layout::ScreenDocked::Height / aspect_ratio,
2284 Layout::ScreenDocked::Height);
2285 } else {
2286 resize(Layout::ScreenDocked::Height / aspect_ratio,
2287 Layout::ScreenDocked::Height + menuBar()->height() +
2288 (ui.action_Show_Status_Bar->isChecked() ? statusBar()->height() : 0));
2289 }
2290}
2291
2275void GMainWindow::OnConfigure() { 2292void GMainWindow::OnConfigure() {
2276 const auto old_theme = UISettings::values.theme; 2293 const auto old_theme = UISettings::values.theme;
2277 const bool old_discord_presence = UISettings::values.enable_discord_presence; 2294 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:
242 void ShowFullscreen(); 242 void ShowFullscreen();
243 void HideFullscreen(); 243 void HideFullscreen();
244 void ToggleWindowMode(); 244 void ToggleWindowMode();
245 void ResetWindowSize(); 245 void ResetWindowSize720();
246 void ResetWindowSize1080();
246 void OnCaptureScreenshot(); 247 void OnCaptureScreenshot();
247 void OnCoreError(Core::System::ResultStatus, std::string); 248 void OnCoreError(Core::System::ResultStatus, std::string);
248 void OnReinitializeKeys(ReinitializeKeyBehavior behavior); 249 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 @@
97 <addaction name="action_Display_Dock_Widget_Headers"/> 97 <addaction name="action_Display_Dock_Widget_Headers"/>
98 <addaction name="action_Show_Filter_Bar"/> 98 <addaction name="action_Show_Filter_Bar"/>
99 <addaction name="action_Show_Status_Bar"/> 99 <addaction name="action_Show_Status_Bar"/>
100 <addaction name="action_Reset_Window_Size"/> 100 <addaction name="action_Reset_Window_Size_720"/>
101 <addaction name="action_Reset_Window_Size_1080"/>
101 <addaction name="separator"/> 102 <addaction name="separator"/>
102 <addaction name="menu_View_Debugging"/> 103 <addaction name="menu_View_Debugging"/>
103 </widget> 104 </widget>
@@ -220,9 +221,14 @@
220 <string>Show Status Bar</string> 221 <string>Show Status Bar</string>
221 </property> 222 </property>
222 </action> 223 </action>
223 <action name="action_Reset_Window_Size"> 224 <action name="action_Reset_Window_Size_720">
224 <property name="text"> 225 <property name="text">
225 <string>Reset Window Size</string> 226 <string>Reset Window Size to 720p</string>
227 </property>
228 </action>
229 <action name="action_Reset_Window_Size_1080">
230 <property name="text">
231 <string>Reset Window Size to 1080p</string>
226 </property> 232 </property>
227 </action> 233 </action>
228 <action name="action_Fullscreen"> 234 <action name="action_Fullscreen">