From 9ec7c51b9c82d6898e35be764c10fd852baefe57 Mon Sep 17 00:00:00 2001 From: Alexis Maiquez Date: Wed, 7 Mar 2018 04:00:57 +0100 Subject: Fixed support for multiple-monitors setup, now the sensors should be drawn on the correct positions Signed-off-by: Alexis Maiquez --- src/app.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src') 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 #include +#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); } -- cgit v1.2.3