QmlDesigner: Replace deprecated color roles in timeline and transition editor

The color roles qmlDesignerBackgroundColorDarkAlternate and
qmlDesignerBackgroundColorDarker are deprecated.

Change-Id: I0c7cabe0eacbcab57a037caa83c338791930420c
Reviewed-by: Knud Dollereder <knud.dollereder@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Thomas Hartmann
2021-03-09 16:00:37 +01:00
parent 38756f1c7a
commit 92da864a86
6 changed files with 13 additions and 17 deletions

View File

@@ -63,7 +63,7 @@ FloatControl::FloatControl()
setMinimum(std::numeric_limits<float>::lowest());
setMaximum(std::numeric_limits<float>::max());
QColor bg = Theme::instance()->qmlDesignerBackgroundColorDarkAlternate();
QColor bg = Theme::getColor(Theme::DScontrolBackground);
auto p = palette();
p.setColor(QPalette::Text, Theme::instance()->color(Utils::Theme::PanelTextColorLight));

View File

@@ -51,9 +51,8 @@ TimelinePlaceholder *TimelinePlaceholder::create(QGraphicsScene * /*parentScene*
void TimelinePlaceholder::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
{
painter->save();
static const QColor penColor = Theme::instance()->qmlDesignerBackgroundColorDarker();
static const QColor backgroundColor = Theme::instance()
->qmlDesignerBackgroundColorDarkAlternate();
static const QColor penColor = Theme::getColor(Theme::BackgroundColorDark);
static const QColor backgroundColor = Theme::getColor(Theme::DScontrolBackground);
static const QColor backgroundColorSection = Theme::getColor(Theme::BackgroundColorDark);
painter->fillRect(0, 0, size().width(), size().height(), backgroundColor);

View File

@@ -368,10 +368,9 @@ void TimelinePropertyItem::paint(QPainter *painter, const QStyleOptionGraphicsIt
{
painter->save();
static const QColor penColor = Theme::instance()->qmlDesignerBackgroundColorDarker();
static const QColor penColor = Theme::getColor(Theme::BackgroundColorDark);
static const QColor textColor = Theme::getColor(Theme::PanelTextColorLight);
static const QColor backgroundColor = Theme::instance()
->qmlDesignerBackgroundColorDarkAlternate();
static const QColor backgroundColor = Theme::getColor(Theme::DScontrolBackground);
static const QPixmap keyframe = TimelineIcons::KEYFRAME.pixmap();
static const QPixmap isKeyframe = TimelineIcons::IS_KEYFRAME.pixmap();

View File

@@ -255,7 +255,7 @@ void TimelineSectionItem::paint(QPainter *painter,
painter->save();
const QColor textColor = Theme::getColor(Theme::PanelTextColorLight);
const QColor penColor = Theme::instance()->qmlDesignerBackgroundColorDarker();
const QColor penColor = Theme::getColor(Theme::BackgroundColorDark);
QColor brushColor = Theme::getColor(Theme::BackgroundColorDark);
int fillOffset = 0;
@@ -273,7 +273,7 @@ void TimelineSectionItem::paint(QPainter *painter,
0,
size().width() - TimelineConstants::sectionWidth,
size().height(),
Theme::instance()->qmlDesignerBackgroundColorDarkAlternate());
Theme::getColor(Theme::DScontrolBackground));
painter->setPen(penColor);
drawLine(painter,
@@ -640,8 +640,7 @@ qreal TimelineRulerSectionItem::endFrame() const
void TimelineRulerSectionItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
{
static const QColor backgroundColor = Theme::instance()
->qmlDesignerBackgroundColorDarkAlternate();
static const QColor backgroundColor = Theme::getColor(Theme::DScontrolBackground);
static const QColor penColor = Theme::getColor(Theme::PanelTextColorLight);
static const QColor highlightColor = Theme::instance()->Theme::qmlDesignerButtonColor();
static const QColor handleColor = Theme::getColor(Theme::QmlDesigner_HighlightColor);

View File

@@ -121,10 +121,9 @@ void TransitionEditorPropertyItem::paint(QPainter *painter,
{
painter->save();
static const QColor penColor = Theme::instance()->qmlDesignerBackgroundColorDarker();
static const QColor penColor = Theme::getColor(Theme::BackgroundColorDark);
static const QColor textColor = Theme::getColor(Theme::PanelTextColorLight);
static const QColor backgroundColor = Theme::instance()
->qmlDesignerBackgroundColorDarkAlternate();
static const QColor backgroundColor = Theme::getColor(Theme::DScontrolBackground);
painter->fillRect(0, 0, TimelineConstants::sectionWidth, size().height(), backgroundColor);
painter->fillRect(TimelineConstants::textIndentationProperties - 4,

View File

@@ -302,8 +302,8 @@ void TransitionEditorSectionItem::paint(QPainter *painter,
painter->save();
const QColor textColor = Theme::getColor(Theme::PanelTextColorLight);
const QColor penColor = Theme::instance()->qmlDesignerBackgroundColorDarker();
QColor brushColor = Theme::getColor(Theme::BackgroundColorDark);
const QColor penColor = Theme::getColor(Theme::BackgroundColorDark);
QColor brushColor = Theme::getColor(Theme::DScontrolBackground);
int fillOffset = 0;
if (isSelected()) {
@@ -320,7 +320,7 @@ void TransitionEditorSectionItem::paint(QPainter *painter,
0,
size().width() - TimelineConstants::sectionWidth,
size().height(),
Theme::instance()->qmlDesignerBackgroundColorDarkAlternate());
Theme::getColor(Theme::DScontrolBackground));
painter->setPen(penColor);
drawLine(painter,