forked from qt-creator/qt-creator
QmlDesigner: Use theme colors for easing curve editor
Change-Id: I38969d88caf6ad536c19fbf0998e19230559ceb1 Reviewed-by: Knud Dollereder <knud.dollereder@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
|
||||
#include "timelinecontrols.h"
|
||||
|
||||
#include <theme.h>
|
||||
|
||||
#include <QColor>
|
||||
#include <QDialog>
|
||||
|
||||
@@ -41,14 +43,14 @@ struct CanvasStyle
|
||||
qreal thinLineWidth = 0.3;
|
||||
qreal thickLineWidth = 2.5;
|
||||
|
||||
QColor thinLineColor = qRgb(0x99, 0x99, 0x99);
|
||||
QColor thickLineColor = qRgb(0x5f, 0x5f, 0x5f);
|
||||
QColor thinLineColor = Theme::getColor(Theme::DSscrollBarHandle);
|
||||
QColor thickLineColor = Theme::getColor(Theme::DSscrollBarHandle);
|
||||
|
||||
qreal handleSize = 7.0;
|
||||
qreal handleLineWidth = 2.0;
|
||||
|
||||
QColor endPointColor = qRgb(0xd6, 0xd3, 0x51);
|
||||
QColor interPointColor = qRgb(0xce, 0x17, 0x17);
|
||||
QColor endPointColor = Theme::getColor(Theme::IconsWarningToolBarColor);
|
||||
QColor interPointColor = Theme::getColor(Theme::DSerrorColor);
|
||||
|
||||
qreal curveWidth = 3.0;
|
||||
};
|
||||
|
@@ -91,21 +91,18 @@ void SplineEditor::paintEvent(QPaintEvent *)
|
||||
{
|
||||
QPainter painter(this);
|
||||
|
||||
QPen pen(Qt::black);
|
||||
QPen pen(Theme::getColor(Theme::DScontrolOutline));
|
||||
pen.setWidth(1);
|
||||
painter.drawRect(0, 0, width() - 1, height() - 1);
|
||||
|
||||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
|
||||
pen = QPen(Qt::darkGray);
|
||||
pen.setWidth(1);
|
||||
painter.setPen(pen);
|
||||
|
||||
QColor curveColor = Qt::white;
|
||||
QColor curveColor = Theme::getColor(Theme::PanelTextColorLight);
|
||||
if (!m_curve.isLegal())
|
||||
curveColor = Qt::red;
|
||||
curveColor = Theme::getColor(Theme::DSerrorColor);
|
||||
|
||||
QBrush background(Theme::getColor(Theme::BackgroundColorDark));
|
||||
|
||||
QBrush background(Theme::instance()->qmlDesignerBackgroundColorDarker());
|
||||
m_canvas.paintGrid(&painter, background);
|
||||
m_canvas.paintCurve(&painter, m_curve, curveColor);
|
||||
m_canvas.paintControlPoints(&painter, m_curve);
|
||||
|
Reference in New Issue
Block a user