From 51b0e2bf53eb74b3041a98908ba32aaeaf4ed253 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 9 Oct 2013 18:12:02 +0200 Subject: use native background color in spline dialog Signed-off-by: Stanislaw Halik --- qfunctionconfigurator/qfunctionconfigurator.cpp | 14 +++----------- qfunctionconfigurator/qfunctionconfigurator.h | 12 ------------ 2 files changed, 3 insertions(+), 23 deletions(-) (limited to 'qfunctionconfigurator') diff --git a/qfunctionconfigurator/qfunctionconfigurator.cpp b/qfunctionconfigurator/qfunctionconfigurator.cpp index 0bd9aad0..802c0a1d 100644 --- a/qfunctionconfigurator/qfunctionconfigurator.cpp +++ b/qfunctionconfigurator/qfunctionconfigurator.cpp @@ -140,15 +140,14 @@ void QFunctionConfigurator::drawBackground(const QRectF &fullRect) QRect scale; _background = QPixmap(fullRect.width(), fullRect.height()); + QColor bgColor = palette().color(QPalette::Normal, QPalette::Background); QPainter painter(&_background); - - painter.save(); + painter.fillRect(fullRect, bgColor); painter.setRenderHint(QPainter::Antialiasing); - painter.fillRect(fullRect, colBackground); QColor bg_color(112, 154, 209); painter.fillRect(range, bg_color); - QFont font("ComicSans", 4); + QFont font; font.setPointSize(8); painter.setFont(font); @@ -200,8 +199,6 @@ void QFunctionConfigurator::drawBackground(const QRectF &fullRect) pen.setColor( Qt::black ); drawLine(&painter, range.topLeft() - QPointF(2,0), range.bottomLeft() - QPointF(2,0), pen); drawLine(&painter, range.bottomLeft(), range.bottomRight(), pen); - - painter.restore(); } @@ -628,11 +625,6 @@ void QFunctionConfigurator::setColorBezier(QColor color) colBezier = color; update(); } -void QFunctionConfigurator::setColorBackground(QColor color) -{ - colBackground = color; - update(); -} void QFunctionConfigurator::setInputEGU(QString egu) { diff --git a/qfunctionconfigurator/qfunctionconfigurator.h b/qfunctionconfigurator/qfunctionconfigurator.h index 6669f92e..07eeeae3 100644 --- a/qfunctionconfigurator/qfunctionconfigurator.h +++ b/qfunctionconfigurator/qfunctionconfigurator.h @@ -63,7 +63,6 @@ class FTNOIR_TRACKER_BASE_EXPORT QFunctionConfigurator : public QWidget Q_PROPERTY(int gridDistEGU_Output READ gridDistEGU_Output WRITE setgridDistEGU_Output) Q_PROPERTY(QColor colorBezier READ colorBezier WRITE setColorBezier) - Q_PROPERTY(QColor colorBackground READ colorBackground WRITE setColorBackground) Q_PROPERTY(QString stringInputEGU READ stringInputEGU WRITE setInputEGU) Q_PROPERTY(QString stringOutputEGU READ stringOutputEGU WRITE setOutputEGU) Q_PROPERTY(QString stringCaption READ stringCaption WRITE setCaption) @@ -94,27 +93,18 @@ class FTNOIR_TRACKER_BASE_EXPORT QFunctionConfigurator : public QWidget return gDistEGU_Output; } - // Return the current color to Designer QColor colorBezier() const { return colBezier; } - // Return the current color to Designer - QColor colorBackground() const - { - return colBackground; - } - // Return the current string to Designer QString stringInputEGU() const { return strInputEGU; } - // Return the current string to Designer QString stringOutputEGU() const { return strOutputEGU; } - // Return the current string to Designer QString stringCaption() const { return strCaption; @@ -140,7 +130,6 @@ public slots: void setgridDistEGU_Output(int); void setColorBezier(QColor); - void setColorBackground(QColor); void setInputEGU(QString); void setOutputEGU(QString); void setCaption(QString); @@ -179,7 +168,6 @@ private: int gDistEGU_Output; // Distance of the grid, in EGU of Output QColor colBezier; // Color of Bezier curve - QColor colBackground; // Color of widget background QString strInputEGU; // Engineering Units input (vertical axis) QString strOutputEGU; // Engineering Units output (horizontal axis) QString strCaption; // Caption of the graph -- cgit v1.2.3