forked from qt-creator/qt-creator
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:
@@ -63,7 +63,7 @@ FloatControl::FloatControl()
|
|||||||
setMinimum(std::numeric_limits<float>::lowest());
|
setMinimum(std::numeric_limits<float>::lowest());
|
||||||
setMaximum(std::numeric_limits<float>::max());
|
setMaximum(std::numeric_limits<float>::max());
|
||||||
|
|
||||||
QColor bg = Theme::instance()->qmlDesignerBackgroundColorDarkAlternate();
|
QColor bg = Theme::getColor(Theme::DScontrolBackground);
|
||||||
|
|
||||||
auto p = palette();
|
auto p = palette();
|
||||||
p.setColor(QPalette::Text, Theme::instance()->color(Utils::Theme::PanelTextColorLight));
|
p.setColor(QPalette::Text, Theme::instance()->color(Utils::Theme::PanelTextColorLight));
|
||||||
|
@@ -51,9 +51,8 @@ TimelinePlaceholder *TimelinePlaceholder::create(QGraphicsScene * /*parentScene*
|
|||||||
void TimelinePlaceholder::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
|
void TimelinePlaceholder::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
|
||||||
{
|
{
|
||||||
painter->save();
|
painter->save();
|
||||||
static const QColor penColor = Theme::instance()->qmlDesignerBackgroundColorDarker();
|
static const QColor penColor = Theme::getColor(Theme::BackgroundColorDark);
|
||||||
static const QColor backgroundColor = Theme::instance()
|
static const QColor backgroundColor = Theme::getColor(Theme::DScontrolBackground);
|
||||||
->qmlDesignerBackgroundColorDarkAlternate();
|
|
||||||
static const QColor backgroundColorSection = Theme::getColor(Theme::BackgroundColorDark);
|
static const QColor backgroundColorSection = Theme::getColor(Theme::BackgroundColorDark);
|
||||||
|
|
||||||
painter->fillRect(0, 0, size().width(), size().height(), backgroundColor);
|
painter->fillRect(0, 0, size().width(), size().height(), backgroundColor);
|
||||||
|
@@ -368,10 +368,9 @@ void TimelinePropertyItem::paint(QPainter *painter, const QStyleOptionGraphicsIt
|
|||||||
{
|
{
|
||||||
painter->save();
|
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 textColor = Theme::getColor(Theme::PanelTextColorLight);
|
||||||
static const QColor backgroundColor = Theme::instance()
|
static const QColor backgroundColor = Theme::getColor(Theme::DScontrolBackground);
|
||||||
->qmlDesignerBackgroundColorDarkAlternate();
|
|
||||||
|
|
||||||
static const QPixmap keyframe = TimelineIcons::KEYFRAME.pixmap();
|
static const QPixmap keyframe = TimelineIcons::KEYFRAME.pixmap();
|
||||||
static const QPixmap isKeyframe = TimelineIcons::IS_KEYFRAME.pixmap();
|
static const QPixmap isKeyframe = TimelineIcons::IS_KEYFRAME.pixmap();
|
||||||
|
@@ -255,7 +255,7 @@ void TimelineSectionItem::paint(QPainter *painter,
|
|||||||
painter->save();
|
painter->save();
|
||||||
|
|
||||||
const QColor textColor = Theme::getColor(Theme::PanelTextColorLight);
|
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);
|
QColor brushColor = Theme::getColor(Theme::BackgroundColorDark);
|
||||||
|
|
||||||
int fillOffset = 0;
|
int fillOffset = 0;
|
||||||
@@ -273,7 +273,7 @@ void TimelineSectionItem::paint(QPainter *painter,
|
|||||||
0,
|
0,
|
||||||
size().width() - TimelineConstants::sectionWidth,
|
size().width() - TimelineConstants::sectionWidth,
|
||||||
size().height(),
|
size().height(),
|
||||||
Theme::instance()->qmlDesignerBackgroundColorDarkAlternate());
|
Theme::getColor(Theme::DScontrolBackground));
|
||||||
|
|
||||||
painter->setPen(penColor);
|
painter->setPen(penColor);
|
||||||
drawLine(painter,
|
drawLine(painter,
|
||||||
@@ -640,8 +640,7 @@ qreal TimelineRulerSectionItem::endFrame() const
|
|||||||
|
|
||||||
void TimelineRulerSectionItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
|
void TimelineRulerSectionItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
|
||||||
{
|
{
|
||||||
static const QColor backgroundColor = Theme::instance()
|
static const QColor backgroundColor = Theme::getColor(Theme::DScontrolBackground);
|
||||||
->qmlDesignerBackgroundColorDarkAlternate();
|
|
||||||
static const QColor penColor = Theme::getColor(Theme::PanelTextColorLight);
|
static const QColor penColor = Theme::getColor(Theme::PanelTextColorLight);
|
||||||
static const QColor highlightColor = Theme::instance()->Theme::qmlDesignerButtonColor();
|
static const QColor highlightColor = Theme::instance()->Theme::qmlDesignerButtonColor();
|
||||||
static const QColor handleColor = Theme::getColor(Theme::QmlDesigner_HighlightColor);
|
static const QColor handleColor = Theme::getColor(Theme::QmlDesigner_HighlightColor);
|
||||||
|
@@ -121,10 +121,9 @@ void TransitionEditorPropertyItem::paint(QPainter *painter,
|
|||||||
{
|
{
|
||||||
painter->save();
|
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 textColor = Theme::getColor(Theme::PanelTextColorLight);
|
||||||
static const QColor backgroundColor = Theme::instance()
|
static const QColor backgroundColor = Theme::getColor(Theme::DScontrolBackground);
|
||||||
->qmlDesignerBackgroundColorDarkAlternate();
|
|
||||||
|
|
||||||
painter->fillRect(0, 0, TimelineConstants::sectionWidth, size().height(), backgroundColor);
|
painter->fillRect(0, 0, TimelineConstants::sectionWidth, size().height(), backgroundColor);
|
||||||
painter->fillRect(TimelineConstants::textIndentationProperties - 4,
|
painter->fillRect(TimelineConstants::textIndentationProperties - 4,
|
||||||
|
@@ -302,8 +302,8 @@ void TransitionEditorSectionItem::paint(QPainter *painter,
|
|||||||
painter->save();
|
painter->save();
|
||||||
|
|
||||||
const QColor textColor = Theme::getColor(Theme::PanelTextColorLight);
|
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);
|
QColor brushColor = Theme::getColor(Theme::DScontrolBackground);
|
||||||
|
|
||||||
int fillOffset = 0;
|
int fillOffset = 0;
|
||||||
if (isSelected()) {
|
if (isSelected()) {
|
||||||
@@ -320,7 +320,7 @@ void TransitionEditorSectionItem::paint(QPainter *painter,
|
|||||||
0,
|
0,
|
||||||
size().width() - TimelineConstants::sectionWidth,
|
size().width() - TimelineConstants::sectionWidth,
|
||||||
size().height(),
|
size().height(),
|
||||||
Theme::instance()->qmlDesignerBackgroundColorDarkAlternate());
|
Theme::getColor(Theme::DScontrolBackground));
|
||||||
|
|
||||||
painter->setPen(penColor);
|
painter->setPen(penColor);
|
||||||
drawLine(painter,
|
drawLine(painter,
|
||||||
|
Reference in New Issue
Block a user