aboutsummaryrefslogtreecommitdiff
path: root/src/app.cpp
diff options
context:
space:
mode:
authornullraum <noah.andreas@nukura.com>2018-03-23 11:45:15 +0100
committerGitHub <noreply@github.com>2018-03-23 11:45:15 +0100
commitea6ce860bde895426277e7b76738733f92554bf8 (patch)
tree665511ef229ef38057f3a40201f97efb01bd60d2 /src/app.cpp
parent958fdca8476c754b339c66a03aa853dcb51753a7 (diff)
parent9ec7c51b9c82d6898e35be764c10fd852baefe57 (diff)
downloadlead-ea6ce860bde895426277e7b76738733f92554bf8.tar
lead-ea6ce860bde895426277e7b76738733f92554bf8.tar.gz
lead-ea6ce860bde895426277e7b76738733f92554bf8.zip
Merge pull request #6 from Almamu/master
Fix for multihead setups
Diffstat (limited to 'src/app.cpp')
-rw-r--r--src/app.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/app.cpp b/src/app.cpp
index 1a34777..0e3075a 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -31,6 +31,8 @@ SOFTWARE.
#include <QScreen>
#include <QFileSystemWatcher>
+#define SENSOR_WIDTH 5
+#define SENSOR_HEIGHT 5
namespace Lead {
@@ -119,14 +121,14 @@ App::loadScreen(QScreen* screen)
QRect rec = screen->geometry();
- loadSensor(screen, "top", rec.width() / 3, 0, rec.width() / 3, 10);
- loadSensor(screen, "right", rec.width() - 1, rec.height() / 3, 1, rec.height() / 3);
- loadSensor(screen, "bottom", rec.width() / 3, rec.height() - 1, rec.width() / 3, 1);
- loadSensor(screen, "left", 0, rec.height() / 3, 1, rec.height() / 3);
- loadSensor(screen, "topLeft", 0, 0, 1, 1);
- loadSensor(screen, "topRight", rec.width() - 1, 0, 1, 1);
- loadSensor(screen, "bottomRight", rec.width() - 1, rec.height() - 1, 1, 1);
- loadSensor(screen, "bottomLeft", 0, rec.height() - 1, 1, 1);
+ loadSensor(screen, "top", rec.x() + (rec.width() / 3), rec.y(), rec.width() / 3, SENSOR_WIDTH);
+ loadSensor(screen, "right", rec.x() + rec.width() - SENSOR_WIDTH, rec.y() + (rec.height() / 3), SENSOR_WIDTH, rec.height() / 3);
+ loadSensor(screen, "bottom", rec.x() + (rec.width() / 3), rec.y() + rec.height() - SENSOR_HEIGHT, rec.width() / 3, SENSOR_HEIGHT);
+ loadSensor(screen, "left", 0, rec.x() + (rec.height() / 3), SENSOR_WIDTH, rec.height() / 3);
+ loadSensor(screen, "topLeft", rec.x(), rec.y(), SENSOR_WIDTH, SENSOR_HEIGHT);
+ loadSensor(screen, "topRight", rec.x() + rec.width() - SENSOR_WIDTH, rec.y(), SENSOR_WIDTH, SENSOR_HEIGHT);
+ loadSensor(screen, "bottomRight", rec.x() + rec.width() - SENSOR_WIDTH, rec.y() + rec.height() - SENSOR_HEIGHT, SENSOR_WIDTH, SENSOR_HEIGHT);
+ loadSensor(screen, "bottomLeft", rec.x(), rec.y() + rec.height() - SENSOR_HEIGHT, SENSOR_WIDTH, SENSOR_HEIGHT);
}