Implementation of screen rotation without use of additional layouts.
This is based on what was done using additional layouts, but modified to have a variable to control rotation and making it so Single Screen Layout behaves like Upright Single would, and Default Layout behaves like Upright Double would, when the new variable is used. Large Layout and Side Layout currently ignore the new variable. New variable still currently doesn't have a hotkey.
This commit is contained in:
@@ -296,6 +296,7 @@ void Config::ReadLayoutValues() {
|
||||
Settings::values.layout_option =
|
||||
static_cast<Settings::LayoutOption>(ReadSetting(QStringLiteral("layout_option")).toInt());
|
||||
Settings::values.swap_screen = ReadSetting(QStringLiteral("swap_screen"), false).toBool();
|
||||
Settings::values.upright_screen = ReadSetting(QStringLiteral("upright_screen"), false).toBool();
|
||||
Settings::values.custom_layout = ReadSetting(QStringLiteral("custom_layout"), false).toBool();
|
||||
Settings::values.custom_top_left = ReadSetting(QStringLiteral("custom_top_left"), 0).toInt();
|
||||
Settings::values.custom_top_top = ReadSetting(QStringLiteral("custom_top_top"), 0).toInt();
|
||||
@@ -765,6 +766,7 @@ void Config::SaveLayoutValues() {
|
||||
WriteSetting(QStringLiteral("filter_mode"), Settings::values.filter_mode, true);
|
||||
WriteSetting(QStringLiteral("layout_option"), static_cast<int>(Settings::values.layout_option));
|
||||
WriteSetting(QStringLiteral("swap_screen"), Settings::values.swap_screen, false);
|
||||
WriteSetting(QStringLiteral("upright_screen"), Settings::values.upright_screen, false);
|
||||
WriteSetting(QStringLiteral("custom_layout"), Settings::values.custom_layout, false);
|
||||
WriteSetting(QStringLiteral("custom_top_left"), Settings::values.custom_top_left, 0);
|
||||
WriteSetting(QStringLiteral("custom_top_top"), Settings::values.custom_top_top, 0);
|
||||
|
@@ -53,6 +53,7 @@ void ConfigureEnhancements::SetConfiguration() {
|
||||
ui->layout_combobox->setCurrentIndex(static_cast<int>(Settings::values.layout_option));
|
||||
ui->swap_screen->setChecked(Settings::values.swap_screen);
|
||||
ui->toggle_disk_shader_cache->setChecked(Settings::values.use_disk_shader_cache);
|
||||
ui->upright_screen->setChecked(Settings::values.upright_screen);
|
||||
ui->toggle_dump_textures->setChecked(Settings::values.dump_textures);
|
||||
ui->toggle_custom_textures->setChecked(Settings::values.custom_textures);
|
||||
ui->toggle_preload_textures->setChecked(Settings::values.preload_textures);
|
||||
@@ -101,6 +102,7 @@ void ConfigureEnhancements::ApplyConfiguration() {
|
||||
static_cast<Settings::LayoutOption>(ui->layout_combobox->currentIndex());
|
||||
Settings::values.swap_screen = ui->swap_screen->isChecked();
|
||||
Settings::values.use_disk_shader_cache = ui->toggle_disk_shader_cache->isChecked();
|
||||
Settings::values.upright_screen = ui->upright_screen->isChecked();
|
||||
Settings::values.dump_textures = ui->toggle_dump_textures->isChecked();
|
||||
Settings::values.custom_textures = ui->toggle_custom_textures->isChecked();
|
||||
Settings::values.preload_textures = ui->toggle_preload_textures->isChecked();
|
||||
|
@@ -239,6 +239,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="upright_screen">
|
||||
<property name="text">
|
||||
<string>Rotate Screens Upright</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
|
@@ -618,6 +618,8 @@ void GMainWindow::ConnectMenuEvents() {
|
||||
&GMainWindow::ChangeScreenLayout);
|
||||
connect(ui.action_Screen_Layout_Swap_Screens, &QAction::triggered, this,
|
||||
&GMainWindow::OnSwapScreens);
|
||||
connect(ui.action_Screen_Layout_Upright_Screens, &QAction::triggered, this,
|
||||
&GMainWindow::OnRotateScreens);
|
||||
|
||||
// Movie
|
||||
connect(ui.action_Record_Movie, &QAction::triggered, this, &GMainWindow::OnRecordMovie);
|
||||
@@ -1435,6 +1437,11 @@ void GMainWindow::OnSwapScreens() {
|
||||
Settings::Apply();
|
||||
}
|
||||
|
||||
void GMainWindow::OnRotateScreens() {
|
||||
Settings::values.upright_screen = ui.action_Screen_Layout_Upright_Screens->isChecked();
|
||||
Settings::Apply();
|
||||
}
|
||||
|
||||
void GMainWindow::OnCheats() {
|
||||
CheatDialog cheat_dialog(this);
|
||||
cheat_dialog.exec();
|
||||
@@ -2032,6 +2039,7 @@ void GMainWindow::SyncMenuUISettings() {
|
||||
ui.action_Screen_Layout_Side_by_Side->setChecked(Settings::values.layout_option ==
|
||||
Settings::LayoutOption::SideScreen);
|
||||
ui.action_Screen_Layout_Swap_Screens->setChecked(Settings::values.swap_screen);
|
||||
ui.action_Screen_Layout_Upright_Screens->setChecked(Settings::values.upright_screen);
|
||||
}
|
||||
|
||||
void GMainWindow::RetranslateStatusBar() {
|
||||
|
@@ -187,6 +187,7 @@ private slots:
|
||||
void ChangeScreenLayout();
|
||||
void ToggleScreenLayout();
|
||||
void OnSwapScreens();
|
||||
void OnRotateScreens();
|
||||
void OnCheats();
|
||||
void ShowFullscreen();
|
||||
void HideFullscreen();
|
||||
|
@@ -110,6 +110,7 @@
|
||||
<addaction name="action_Screen_Layout_Side_by_Side"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_Screen_Layout_Swap_Screens"/>
|
||||
<addaction name="action_Screen_Layout_Upright_Screens"/>
|
||||
</widget>
|
||||
<addaction name="action_Fullscreen"/>
|
||||
<addaction name="action_Single_Window_Mode"/>
|
||||
@@ -425,6 +426,14 @@
|
||||
<string>Swap Screens</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_Screen_Layout_Upright_Screens">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Rotate Upright</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_Check_For_Updates">
|
||||
<property name="text">
|
||||
<string>Check for Updates</string>
|
||||
|
Reference in New Issue
Block a user