diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-09-05 08:09:50 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-09-05 08:12:45 +0200 |
commit | 590ed20fe73848607ff40f2620c413f8ec5ac0ee (patch) | |
tree | 51bd7c4b2b87591db446f4189a03913a1e4b1bd3 | |
parent | bed620cc85b71e5c02c86613d22624a5c12189ce (diff) |
qfc: don't allow editing when disabled
Sponsored-by: TrackHat
-rw-r--r-- | qfunctionconfigurator/qfunctionconfigurator.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/qfunctionconfigurator/qfunctionconfigurator.cpp b/qfunctionconfigurator/qfunctionconfigurator.cpp index d9cf6d52..144b69e1 100644 --- a/qfunctionconfigurator/qfunctionconfigurator.cpp +++ b/qfunctionconfigurator/qfunctionconfigurator.cpp @@ -40,6 +40,8 @@ void QFunctionConfigurator::drawBackground() painter.fillRect(rect(), QColor::fromRgb(204, 204, 204)); QColor bg_color(112, 154, 209); + if (!isEnabled()) + bg_color = QColor(176,176,180); painter.fillRect(pixel_bounds, bg_color); QFont font; @@ -205,7 +207,7 @@ void QFunctionConfigurator::drawLine(QPainter *painter, const QPointF &start, co void QFunctionConfigurator::mousePressEvent(QMouseEvent *e) { - if (!_config) + if (!_config || !isEnabled()) return; QList<QPointF> points = _config->getPoints(); if (e->button() == Qt::LeftButton) { @@ -262,7 +264,7 @@ void QFunctionConfigurator::mousePressEvent(QMouseEvent *e) void QFunctionConfigurator::mouseMoveEvent(QMouseEvent *e) { - if (!_config) + if (!_config || !isEnabled()) return; QList<QPointF> points = _config->getPoints(); @@ -337,7 +339,7 @@ void QFunctionConfigurator::mouseMoveEvent(QMouseEvent *e) void QFunctionConfigurator::mouseReleaseEvent(QMouseEvent *e) { - if (!_config) + if (!_config || !isEnabled()) return; if (e->button() == Qt::LeftButton) { |