X-Git-Url: http://git.maemo.org/git/?p=weightgraph;a=blobdiff_plain;f=weightgraph%2Fweightgraphview.h;fp=weightgraph%2Fweightgraphview.h;h=87ffcfad32a3485e4518b20a78dfe8708795f7d1;hp=835b735f796d55dd8ccdaae097386f79a8dfa992;hb=838ef73bd1b3b40b6ee848ade0e0a5441e75d870;hpb=43cbeb0e6bbc73770d660f84b89610f1aa597f60 diff --git a/weightgraph/weightgraphview.h b/weightgraph/weightgraphview.h index 835b735..87ffcfa 100644 --- a/weightgraph/weightgraphview.h +++ b/weightgraph/weightgraphview.h @@ -3,6 +3,7 @@ #include #include +#include #include "weightdata.h" #include "settings.h" @@ -12,31 +13,17 @@ class WeightGraphView : public QWidget public: explicit WeightGraphView(WeightDataModel *wdm, const QString &id, QWidget *parent = 0); QSize sizeHint() const; + void grabZoomKeys(bool grab); + static void grabZoomKeysForWindow(WId winId, bool grab); signals: void clicked(); public slots: void paintEvent(QPaintEvent *); void show(); - void update() { - grabZoomKeys(Settings::grabZoomKeys()); - QWidget::update(); - } + void update(); - void grabZoomKeys(bool grab); - void incPeriod() { - if (period == 0) - period = wdm->getWeights().first().date.daysTo(wdm->getWeights().last().date) + 1; - else - period++; - update(); - } - void decPeriod() { - if (period == 0) - period = wdm->getWeights().first().date.daysTo(wdm->getWeights().last().date) - 1; - else - period = qMax(1, period-1); - update(); - } + void incPeriod(); + void decPeriod(); void setPeriod(int period) { this->period = period; update(); } protected: void mousePressEvent(QMouseEvent *);