summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-10-27 14:08:11 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-10-27 16:43:04 +0200
commit8f8014bf7178c6c06d5bb1760ba6619f161d1ac6 (patch)
treed937df5b46ae3e81b03458ddaca8167896a2b2db
parent52e73f03f27104c094a9b8e66076a9c593a3c869 (diff)
spline/widget: try fix background color on Unix
-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;