diff options
| author | MageJohn <magejohnyjtp@gmail.com> | 2019-02-18 23:34:31 +0000 |
|---|---|---|
| committer | MageJohn <magejohnyjtp@gmail.com> | 2019-02-18 23:34:31 +0000 |
| commit | a79a11d22dcb1bb0cbe47874d7f8ff5d58f2271a (patch) | |
| tree | 37d3347671d5080a75c3c65c4be8a6b0b7e7d2ed /src/sensor.h | |
| parent | fe8218f49006190ee779a80173b5cf54eed1ca92 (diff) | |
| download | lead-a79a11d22dcb1bb0cbe47874d7f8ff5d58f2271a.tar lead-a79a11d22dcb1bb0cbe47874d7f8ff5d58f2271a.tar.gz lead-a79a11d22dcb1bb0cbe47874d7f8ff5d58f2271a.zip | |
Implement basic delay support
The ini file now has two entries for each corner, one for the action to
be performed and one for the interval after which it will be performed
if the mouse doesn't leave the hot corner/edge. This is a little
inelegant, and I'd like to make the ini file nicer at some point.
Diffstat (limited to 'src/sensor.h')
| -rw-r--r-- | src/sensor.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/sensor.h b/src/sensor.h index 0a400b6..ed5add8 100644 --- a/src/sensor.h +++ b/src/sensor.h @@ -30,6 +30,7 @@ SOFTWARE. #include <QWidget> #include <QScreen> +#include <QTimer> namespace Lead { @@ -40,14 +41,21 @@ class Sensor : public QWidget Q_OBJECT public: - explicit Sensor(int x, int y, int w, int h, QString action); + explicit Sensor(int x, int y, int w, int h, QString action, int interval); ~Sensor(); protected: void enterEvent(QEvent * event); + void leaveEvent(QEvent * event); private: QString action; + QTimer *timer; + int interval; + +public slots: + void activate(); + }; |
