summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--spline/spline-widget.cpp8
-rw-r--r--spline/spline-widget.hpp1
2 files changed, 4 insertions, 5 deletions
diff --git a/spline/spline-widget.cpp b/spline/spline-widget.cpp
index 68d009c5..67751840 100644
--- a/spline/spline-widget.cpp
+++ b/spline/spline-widget.cpp
@@ -101,7 +101,7 @@ void spline_widget::drawBackground()
QPainter painter(&_background);
- painter.fillRect(rect(), palette().background().color());
+ painter.fillRect(rect(), widget_bg_color);
{
QColor bg_color(112, 154, 209);
@@ -253,15 +253,13 @@ void spline_widget::drawFunction()
}
#endif
- const QColor bg = palette().background().color();
-
const QRect r1(pixel_bounds.left(), 0, width() - pixel_bounds.left(), pixel_bounds.top()),
r2(pixel_bounds.right(), 0, width() - pixel_bounds.right(), pixel_bounds.bottom());
// prevent topward artifacts the lazy way
- painter.fillRect(r1, bg);
+ painter.fillRect(r1, widget_bg_color);
// same for rightward artifacts
- painter.fillRect(r2, bg);
+ painter.fillRect(r2, widget_bg_color);
const int alpha = !isEnabled() ? 64 : 120;
if (!_preview_only)
diff --git a/spline/spline-widget.hpp b/spline/spline-widget.hpp
index 711bdb2a..d38eeeee 100644
--- a/spline/spline-widget.hpp
+++ b/spline/spline-widget.hpp
@@ -90,6 +90,7 @@ private:
QPixmap _background;
QPixmap _function;
QColor spline_color;
+ QColor widget_bg_color = palette().background().color();
// bounds of the rectangle user can interact with
QRect pixel_bounds;