From 590ed20fe73848607ff40f2620c413f8ec5ac0ee Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 5 Sep 2015 08:09:50 +0200 Subject: qfc: don't allow editing when disabled Sponsored-by: TrackHat --- qfunctionconfigurator/qfunctionconfigurator.cpp | 8 +++++--- 1 file 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 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 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) { -- cgit v1.2.3