diff options
| author | Alexis Maiquez <almamu@almamu.com> | 2018-03-07 04:00:57 +0100 |
|---|---|---|
| committer | Alexis Maiquez <almamu@almamu.com> | 2018-03-07 04:00:57 +0100 |
| commit | 9ec7c51b9c82d6898e35be764c10fd852baefe57 (patch) | |
| tree | 665511ef229ef38057f3a40201f97efb01bd60d2 | |
| parent | 958fdca8476c754b339c66a03aa853dcb51753a7 (diff) | |
| download | lead-9ec7c51b9c82d6898e35be764c10fd852baefe57.tar lead-9ec7c51b9c82d6898e35be764c10fd852baefe57.tar.gz lead-9ec7c51b9c82d6898e35be764c10fd852baefe57.zip | |
Fixed support for multiple-monitors setup, now the sensors should be drawn on the correct positions
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
| -rw-r--r-- | src/app.cpp | 18 |
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); } |
