aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/qt_sdl
diff options
context:
space:
mode:
authorRSDuck <rsduck@users.noreply.github.com>2021-01-17 22:16:32 +0100
committerRSDuck <rsduck@users.noreply.github.com>2021-01-17 22:16:32 +0100
commitd529b650c06a4dd43904dfead49011be1ba9db9a (patch)
treeb570480feb296a553134b77cb8ad0291527f2c51 /src/frontend/qt_sdl
parent1d6cc3c6ef8cf724883d3f12fa5a06fe25bf5839 (diff)
implement swapping the position of both screens
closes #855
Diffstat (limited to 'src/frontend/qt_sdl')
-rw-r--r--src/frontend/qt_sdl/PlatformConfig.cpp2
-rw-r--r--src/frontend/qt_sdl/PlatformConfig.h1
-rw-r--r--src/frontend/qt_sdl/main.cpp18
-rw-r--r--src/frontend/qt_sdl/main.h2
4 files changed, 22 insertions, 1 deletions
diff --git a/src/frontend/qt_sdl/PlatformConfig.cpp b/src/frontend/qt_sdl/PlatformConfig.cpp
index 46f8717..30d9172 100644
--- a/src/frontend/qt_sdl/PlatformConfig.cpp
+++ b/src/frontend/qt_sdl/PlatformConfig.cpp
@@ -39,6 +39,7 @@ int WindowMaximized;
int ScreenRotation;
int ScreenGap;
int ScreenLayout;
+int ScreenSwap;
int ScreenSizing;
int IntegerScaling;
int ScreenFilter;
@@ -135,6 +136,7 @@ ConfigEntry PlatformConfigFile[] =
{"ScreenRotation", 0, &ScreenRotation, 0, NULL, 0},
{"ScreenGap", 0, &ScreenGap, 0, NULL, 0},
{"ScreenLayout", 0, &ScreenLayout, 0, NULL, 0},
+ {"ScreenSwap", 0, &ScreenSwap, 0, NULL, 0},
{"ScreenSizing", 0, &ScreenSizing, 0, NULL, 0},
{"IntegerScaling", 0, &IntegerScaling, 0, NULL, 0},
{"ScreenFilter", 0, &ScreenFilter, 1, NULL, 0},
diff --git a/src/frontend/qt_sdl/PlatformConfig.h b/src/frontend/qt_sdl/PlatformConfig.h
index 2d73dea..0bfbb20 100644
--- a/src/frontend/qt_sdl/PlatformConfig.h
+++ b/src/frontend/qt_sdl/PlatformConfig.h
@@ -53,6 +53,7 @@ extern int WindowMaximized;
extern int ScreenRotation;
extern int ScreenGap;
extern int ScreenLayout;
+extern int ScreenSwap;
extern int ScreenSizing;
extern int IntegerScaling;
extern int ScreenFilter;
diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp
index f0185cc..cbaee03 100644
--- a/src/frontend/qt_sdl/main.cpp
+++ b/src/frontend/qt_sdl/main.cpp
@@ -647,7 +647,8 @@ void ScreenHandler::screenSetupLayout(int w, int h)
Config::ScreenRotation,
sizing,
Config::ScreenGap,
- Config::IntegerScaling != 0);
+ Config::IntegerScaling != 0,
+ Config::ScreenSwap != 0);
Frontend::GetScreenTransforms(screenMatrix[0], screenMatrix[1]);
}
@@ -1232,6 +1233,12 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent)
}
connect(grpScreenLayout, &QActionGroup::triggered, this, &MainWindow::onChangeScreenLayout);
+
+ submenu->addSeparator();
+
+ actScreenSwap = submenu->addAction("Swap screens");
+ actScreenSwap->setCheckable(true);
+ connect(actScreenSwap, &QAction::triggered, this, &MainWindow::onChangeScreenSwap);
}
{
QMenu* submenu = menu->addMenu("Screen sizing");
@@ -1315,6 +1322,8 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent)
actScreenSizing[Config::ScreenSizing]->setChecked(true);
actIntegerScaling->setChecked(Config::IntegerScaling != 0);
+ actScreenSwap->setChecked(Config::ScreenSwap != 0);
+
actScreenFiltering->setChecked(Config::ScreenFilter != 0);
actShowOSD->setChecked(Config::ShowOSD != 0);
@@ -2049,6 +2058,13 @@ void MainWindow::onChangeScreenLayout(QAction* act)
emit screenLayoutChange();
}
+void MainWindow::onChangeScreenSwap(bool checked)
+{
+ Config::ScreenSwap = checked?1:0;
+
+ emit screenLayoutChange();
+}
+
void MainWindow::onChangeScreenSizing(QAction* act)
{
int sizing = act->data().toInt();
diff --git a/src/frontend/qt_sdl/main.h b/src/frontend/qt_sdl/main.h
index 97f514b..6dfbd8c 100644
--- a/src/frontend/qt_sdl/main.h
+++ b/src/frontend/qt_sdl/main.h
@@ -222,6 +222,7 @@ private slots:
void onChangeScreenRotation(QAction* act);
void onChangeScreenGap(QAction* act);
void onChangeScreenLayout(QAction* act);
+ void onChangeScreenSwap(bool checked);
void onChangeScreenSizing(QAction* act);
void onChangeIntegerScaling(bool checked);
void onChangeScreenFiltering(bool checked);
@@ -279,6 +280,7 @@ public:
QAction* actScreenGap[6];
QActionGroup* grpScreenLayout;
QAction* actScreenLayout[3];
+ QAction* actScreenSwap;
QActionGroup* grpScreenSizing;
QAction* actScreenSizing[4];
QAction* actIntegerScaling;