Commit ffbb54b0 authored by Scott Petrovic's avatar Scott Petrovic Committed by Scott Petrovic
Browse files

have the curve widget use the application theme and make them easier to read


Signed-off-by: Scott Petrovic's avatarScott Petrovic <scottpetrovic@gmail.com>
parent e87f37d7
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <QKeyEvent> #include <QKeyEvent>
#include <QPaintEvent> #include <QPaintEvent>
#include <QList> #include <QList>
#include <QApplication>
#include <QSpinBox> #include <QSpinBox>
...@@ -262,13 +263,15 @@ void KisCurveWidget::paintEvent(QPaintEvent *) ...@@ -262,13 +263,15 @@ void KisCurveWidget::paintEvent(QPaintEvent *)
QPainter p(this); QPainter p(this);
QPalette appPalette = QApplication::palette();
// Antialiasing is not a good idea here, because // Antialiasing is not a good idea here, because
// the grid will drift one pixel to any side due to rounding of int // the grid will drift one pixel to any side due to rounding of int
// FIXME: let's user tell the last word (in config) // FIXME: let's user tell the last word (in config)
//p.setRenderHint(QPainter::Antialiasing); //p.setRenderHint(QPainter::Antialiasing);
// fill with color to show widget bounds // fill with color to show widget bounds
p.fillRect(rect(), palette().base()); p.fillRect(rect(), appPalette.color(QPalette::Base));
// draw background // draw background
if (!d->m_pix.isNull()) { if (!d->m_pix.isNull()) {
...@@ -297,7 +300,7 @@ void KisCurveWidget::paintEvent(QPaintEvent *) ...@@ -297,7 +300,7 @@ void KisCurveWidget::paintEvent(QPaintEvent *)
QPolygonF poly; QPolygonF poly;
p.setPen(QPen(Qt::black, 1, Qt::SolidLine)); p.setPen(QPen(appPalette.color(QPalette::Text), 2, Qt::SolidLine));
for (x = 0 ; x < wWidth ; x++) { for (x = 0 ; x < wWidth ; x++) {
normalizedX = double(x) / wWidth; normalizedX = double(x) / wWidth;
curY = wHeight - d->m_curve.value(normalizedX) * wHeight; curY = wHeight - d->m_curve.value(normalizedX) * wHeight;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment