From 6ecea18b30957649a53ab70c458a8f1a6d91972d Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 6 Jul 2018 11:20:46 +0300 Subject: Move colors from TimelineConstants to CStudioPreferences Task-number: QT3DS-1978 Change-Id: Ic3bb918e3f9f6c5b2d12f43aad7821a83c3cc657 Reviewed-by: Mahmoud Badri Reviewed-by: Miikka Heikkinen --- .../Client/Code/Core/Utility/StudioPreferences.cpp | 169 ++++++++++++++++++--- .../Client/Code/Core/Utility/StudioPreferences.h | 19 +++ .../Palettes/TimelineGraphicsView/RowMover.cpp | 5 +- .../TimelineGraphicsView/TimelineConstants.h | 24 --- .../Palettes/TimelineGraphicsView/ui/PlayHead.cpp | 3 +- .../TimelineGraphicsView/ui/RowTimeline.cpp | 33 ++-- .../Palettes/TimelineGraphicsView/ui/RowTree.cpp | 19 +-- .../Palettes/TimelineGraphicsView/ui/Ruler.cpp | 7 +- .../TimelineGraphicsView/ui/TreeHeader.cpp | 5 +- 9 files changed, 204 insertions(+), 80 deletions(-) diff --git a/src/Authoring/Client/Code/Core/Utility/StudioPreferences.cpp b/src/Authoring/Client/Code/Core/Utility/StudioPreferences.cpp index 71a3e581..e44faa6e 100644 --- a/src/Authoring/Client/Code/Core/Utility/StudioPreferences.cpp +++ b/src/Authoring/Client/Code/Core/Utility/StudioPreferences.cpp @@ -38,29 +38,48 @@ #include #include -::CColor s_BaseColor; -::CColor s_DarkBaseColor; -::CColor s_NormalColor; -::CColor s_MasterColor; -::CColor s_MouseOverHighlightColor; -::CColor s_ButtonDownColor; -::CColor s_DisabledTextColor; - -QColor s_studioColor1; -QColor s_studioColor2; -QColor s_studioColor3; -QColor s_backgroundColor; -QColor s_guideColor; -QColor s_selectionColor; -QColor s_textColor; -QColor s_masterColor; -QColor s_disabledColor; -QColor s_dataInputColor; -int s_fontSize; -int s_controlBaseHeight; -int s_idWidth; -int s_valueWidth; -QSize s_browserPopupSize; +static ::CColor s_BaseColor; +static ::CColor s_DarkBaseColor; +static ::CColor s_NormalColor; +static ::CColor s_MasterColor; +static ::CColor s_MouseOverHighlightColor; +static ::CColor s_ButtonDownColor; +static ::CColor s_DisabledTextColor; + +static QColor s_studioColor1; +static QColor s_studioColor2; +static QColor s_studioColor3; +static QColor s_backgroundColor; +static QColor s_guideColor; +static QColor s_selectionColor; +static QColor s_textColor; +static QColor s_masterColor; +static QColor s_disabledColor; +static QColor s_dataInputColor; + +static QColor s_timelineRowColorNormal; +static QColor s_timelineRowColorNormalProp; +static QColor s_timelineRowColorOver; +static QColor s_timelineRowColorSelected; +static QColor s_timelineRowColorDurationOff1; // duration off ancestors' bounds color1 +static QColor s_timelineRowColorDurationOff2; // duration off ancestors' bounds color2 +static QColor s_timelineRowColorDurationEdge; // duration left and right edge lines +static QColor s_timelineRowColorDurationSelected; +static QColor s_timelineRowColorDndSource; +static QColor s_timelineRowColorDndTarget; +static QColor s_timelineRowMoverColor; +static QColor s_timelineRulerColor; +static QColor s_timelineRulerColorDisabled; +static QColor s_timelineWidgetBgColor; +static QColor s_timelinePlayheadLineColor; +static QColor s_timelineFilterButtonSelectedColor; +static QColor s_timelineFilterButtonHoveredColor; + +static int s_fontSize; +static int s_controlBaseHeight; +static int s_idWidth; +static int s_valueWidth; +static QSize s_browserPopupSize; #define STRINGIFY(x) STRINGIFY2(x) #define STRINGIFY2(x) #x @@ -113,6 +132,25 @@ void CStudioPreferences::LoadPreferences() s_masterColor = QColor("#5caa15"); s_disabledColor = QColor("#727476"); s_dataInputColor = QColor("#ff5102"); + + s_timelineRowColorNormal = QColor("#404040"); + s_timelineRowColorNormalProp = QColor("#373737"); + s_timelineRowColorOver = QColor("#4d4d4d"); + s_timelineRowColorSelected = QColor("#336699"); + s_timelineRowColorDurationOff1 = QColor("#3388B3"); + s_timelineRowColorDurationOff2 = QColor("#222222"); + s_timelineRowColorDurationEdge = QColor("#000000"); + s_timelineRowColorDurationSelected = QColor("#80000000"); + s_timelineRowColorDndSource = QColor("#464600"); + s_timelineRowColorDndTarget = QColor("#292929"); + s_timelineRowMoverColor = QColor("#ffff00"); + s_timelineRulerColor = QColor("#888888"); + s_timelineRulerColorDisabled = QColor("#444444"); + s_timelineWidgetBgColor = QColor("#222222"); + s_timelinePlayheadLineColor = QColor("#b20808"); + s_timelineFilterButtonSelectedColor = QColor("#000000"); + s_timelineFilterButtonHoveredColor = QColor("#40000000"); + s_fontSize = 12; s_controlBaseHeight = 22; s_idWidth = 130; @@ -847,6 +885,91 @@ QColor CStudioPreferences::dataInputColor() return s_dataInputColor; } +QColor CStudioPreferences::timelineRowColorNormal() +{ + return s_timelineRowColorNormal; +} + +QColor CStudioPreferences::timelineRowColorNormalProp() +{ + return s_timelineRowColorNormalProp; +} + +QColor CStudioPreferences::timelineRowColorOver() +{ + return s_timelineRowColorOver; +} + +QColor CStudioPreferences::timelineRowColorSelected() +{ + return s_timelineRowColorSelected; +} + +QColor CStudioPreferences::timelineRowColorDurationOff1() +{ + return s_timelineRowColorDurationOff1; +} + +QColor CStudioPreferences::timelineRowColorDurationOff2() +{ + return s_timelineRowColorDurationOff2; +} + +QColor CStudioPreferences::timelineRowColorDurationEdge() +{ + return s_timelineRowColorDurationEdge; +} + +QColor CStudioPreferences::timelineRowColorDurationSelected() +{ + return s_timelineRowColorDurationSelected; +} + +QColor CStudioPreferences::timelineRowColorDndSource() +{ + return s_timelineRowColorDndSource; +} + +QColor CStudioPreferences::timelineRowColorDndTarget() +{ + return s_timelineRowColorDndTarget; +} + +QColor CStudioPreferences::timelineRowMoverColor() +{ + return s_timelineRowMoverColor; +} + +QColor CStudioPreferences::timelineRulerColor() +{ + return s_timelineRulerColor; +} + +QColor CStudioPreferences::timelineRulerColorDisabled() +{ + return s_timelineRulerColorDisabled; +} + +QColor CStudioPreferences::timelineWidgetBgColor() +{ + return s_timelineWidgetBgColor; +} + +QColor CStudioPreferences::timelinePlayheadLineColor() +{ + return s_timelinePlayheadLineColor; +} + +QColor CStudioPreferences::timelineFilterButtonSelectedColor() +{ + return s_timelineFilterButtonSelectedColor; +} + +QColor CStudioPreferences::timelineFilterButtonHoveredColor() +{ + return s_timelineFilterButtonHoveredColor; +} + int CStudioPreferences::fontSize() { return s_fontSize; diff --git a/src/Authoring/Client/Code/Core/Utility/StudioPreferences.h b/src/Authoring/Client/Code/Core/Utility/StudioPreferences.h index 9e2f79a7..7108fb6a 100644 --- a/src/Authoring/Client/Code/Core/Utility/StudioPreferences.h +++ b/src/Authoring/Client/Code/Core/Utility/StudioPreferences.h @@ -163,6 +163,25 @@ public: static QColor masterColor(); static QColor disabledColor(); static QColor dataInputColor(); + + static QColor timelineRowColorNormal(); + static QColor timelineRowColorNormalProp(); + static QColor timelineRowColorOver(); + static QColor timelineRowColorSelected(); + static QColor timelineRowColorDurationOff1(); + static QColor timelineRowColorDurationOff2(); + static QColor timelineRowColorDurationEdge(); + static QColor timelineRowColorDurationSelected(); + static QColor timelineRowColorDndSource(); + static QColor timelineRowColorDndTarget(); + static QColor timelineRowMoverColor(); + static QColor timelineRulerColor(); + static QColor timelineRulerColorDisabled(); + static QColor timelineWidgetBgColor(); + static QColor timelinePlayheadLineColor(); + static QColor timelineFilterButtonSelectedColor(); + static QColor timelineFilterButtonHoveredColor(); + static int fontSize(); static int controlBaseHeight(); static int idWidth(); diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp index 65be2cdd..ab7e5686 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp @@ -31,6 +31,7 @@ #include "RowManager.h" #include "TimelineGraphicsScene.h" #include "TimelineConstants.h" +#include "StudioPreferences.h" #include #include @@ -66,8 +67,8 @@ void RowMover::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, static const QPolygon polygon({QPoint(0, 0), QPoint(0, 3), QPoint(7, 3), QPoint(7, 1), QPoint(TimelineConstants::TREE_BOUND_W, 1), QPoint(TimelineConstants::TREE_BOUND_W, 0)}); - painter->setPen(QPen(QColor(TimelineConstants::ROW_MOVER_COLOR), 1)); - painter->setBrush(QColor(TimelineConstants::ROW_MOVER_COLOR)); + painter->setPen(QPen(CStudioPreferences::timelineRowMoverColor(), 1)); + painter->setBrush(CStudioPreferences::timelineRowMoverColor()); painter->drawConvexPolygon(polygon); } diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineConstants.h b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineConstants.h index 52a54e7a..e10fbb43 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineConstants.h +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineConstants.h @@ -62,30 +62,6 @@ namespace TimelineConstants const int NAVIGATION_BAR_H = 30; // height of navigation/breadcrumb bar const int TIMEBAR_TOOLTIP_OFFSET_V = 10; - // Colors - const char ROW_COLOR_NORMAL[] = "#404040"; - const char ROW_COLOR_NORMAL_PROP[] = "#373737"; - const char ROW_COLOR_OVER[] = "#4d4d4d"; - const char ROW_COLOR_SELECTED[] = "#336699"; - const char ROW_COLOR_DURATION_OFF1[] = "#3388B3"; // duration off ancestors' bounds color1 - const char ROW_COLOR_DURATION_OFF2[] = "#222222"; // duration off ancestors' bounds color2 - const char ROW_COLOR_DURATION_EDGE[] = "#000000"; // duration left and right edge lines - const char ROW_COLOR_DURATION_SELECTED[] = "#80000000"; - const char ROW_COLOR_DND_SRC[] = "#464600"; - const char ROW_COLOR_DND_TGT[] = "#292929"; - const char ROW_COLOR_DATAINPUT_TEXT[] = "#ffffff"; - const char ROW_COLOR_DATAINPUT_DURATION[] = "#ff5102"; - const char ROW_TEXT_COLOR[] = "#bbbbbb"; - const char ROW_TEXT_COLOR_DISABLED[] = "#888888"; - const char PLAYHEAD_COLOR[] = "#ff0066"; - const char RULER_COLOR[] = "#888888"; - const char RULER_COLOR_DISABLED[] = "#444444"; - const char ROW_MOVER_COLOR[] = "#ffff00"; - const char WIDGET_BG_COLOR[] = "#222222"; - const char PLAYHEAD_LINE_COLOR[] = "#b20808"; - const char FILTER_BUTTON_SELECTED_COLOR[] = "#000000"; - const char FILTER_BUTTON_HOVERED_COLOR[] = "#40000000"; - // Other const int EXPAND_ANIMATION_DURATION = 200; const int AUTO_SCROLL_PERIOD = 50; // time steps (millis) while auto scrolling diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/PlayHead.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/PlayHead.cpp index 769b52bd..35787462 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/PlayHead.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/PlayHead.cpp @@ -29,6 +29,7 @@ #include "PlayHead.h" #include "Ruler.h" #include "TimelineConstants.h" +#include "StudioPreferences.h" #include #include @@ -50,7 +51,7 @@ void PlayHead::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, static const int PLAY_HEAD_H = 999999; // theoretically big enough height painter->drawPixmap(-TimelineConstants::PLAYHEAD_W * .5, 0, pixHead); - painter->setPen(QColor(TimelineConstants::PLAYHEAD_LINE_COLOR)); + painter->setPen(CStudioPreferences::timelinePlayheadLineColor()); painter->drawLine(0, 0, 0, PLAY_HEAD_H); } diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.cpp index 18b309ce..60583eb2 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.cpp @@ -39,6 +39,7 @@ #include "Bindings/ITimelineTimebar.h" #include "Bindings/Qt3DSDMTimelineItemProperty.h" #include "AppFonts.h" +#include "StudioPreferences.h" #include #include @@ -83,13 +84,13 @@ void RowTimeline::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio // Background QColor bgColor; if (m_rowTree->isProperty()) - bgColor = TimelineConstants::ROW_COLOR_NORMAL_PROP; + bgColor = CStudioPreferences::timelineRowColorNormalProp(); else if (m_state == Selected) - bgColor = TimelineConstants::ROW_COLOR_SELECTED; + bgColor = CStudioPreferences::timelineRowColorSelected(); else if (m_state == Hovered && !m_rowTree->m_locked) - bgColor = TimelineConstants::ROW_COLOR_OVER; + bgColor = CStudioPreferences::timelineRowColorOver(); else - bgColor = TimelineConstants::ROW_COLOR_NORMAL; + bgColor = CStudioPreferences::timelineRowColorNormal(); painter->fillRect(0, 0, size().width(), currentHeight, bgColor); } @@ -100,14 +101,14 @@ void RowTimeline::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio // fully outside ancestors' limits, draw fully hashed if (m_minStartX > m_endX || m_maxEndX < m_startX) { - painter->setBrush(QBrush(QColor(TimelineConstants::ROW_COLOR_DURATION_OFF1), + painter->setBrush(QBrush(CStudioPreferences::timelineRowColorDurationOff1(), Qt::BDiagPattern)); painter->setPen(Qt::NoPen); painter->fillRect(QRect(m_startX, 0, m_endX - m_startX, currentHeight), - QColor(TimelineConstants::ROW_COLOR_DURATION_OFF2)); + CStudioPreferences::timelineRowColorDurationOff2()); painter->drawRect(QRect(m_startX, 0, m_endX - m_startX, currentHeight)); - painter->setPen(QPen(QColor(TimelineConstants::ROW_COLOR_DURATION_EDGE), 3)); + painter->setPen(QPen(CStudioPreferences::timelineRowColorDurationEdge(), 2)); painter->drawLine(m_startX, 0, m_startX, currentHeight); painter->drawLine(m_endX, 0, m_endX, currentHeight); } else { @@ -120,7 +121,7 @@ void RowTimeline::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio if (m_controllerDataInput.size()) { painter->fillRect(QRect(x, 0, w, currentHeight), - QColor(TimelineConstants::ROW_COLOR_DATAINPUT_DURATION)); + CStudioPreferences::dataInputColor()); } else if (m_rowTree->indexInLayout() != 1) { painter->fillRect(QRect(x, 0, w, currentHeight), m_barColor); } @@ -128,7 +129,7 @@ void RowTimeline::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio if (m_state == Selected) { // draw selection overlay on bar painter->fillRect(QRect(x, marginY, w, currentHeight - marginY * 2), - QColor(TimelineConstants::ROW_COLOR_DURATION_SELECTED)); + CStudioPreferences::timelineRowColorDurationSelected()); } if (m_controllerDataInput.size()) { @@ -141,7 +142,7 @@ void RowTimeline::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio // for text painter->setClipRect(x, 0, w, currentHeight); painter->setClipping(true); - painter->setPen(QPen(QColor(TimelineConstants::ROW_COLOR_DATAINPUT_TEXT), 2)); + painter->setPen(QPen(CStudioPreferences::textColor(), 2)); painter->drawText(QRect(x + pixDataInput.width(), 0, w, currentHeight), m_controllerDataInput, QTextOption(Qt::AlignCenter)); // place the icon marginY amount away from the datainput name @@ -156,14 +157,14 @@ void RowTimeline::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio } // draw hashed part before - painter->setBrush(QBrush(QColor(TimelineConstants::ROW_COLOR_DURATION_OFF1), + painter->setBrush(QBrush(CStudioPreferences::timelineRowColorDurationOff1(), Qt::BDiagPattern)); if (m_startX < m_minStartX) { painter->setPen(Qt::NoPen); painter->fillRect(QRect(m_startX, 0, m_minStartX - m_startX, currentHeight), - QColor(TimelineConstants::ROW_COLOR_DURATION_OFF2)); + CStudioPreferences::timelineRowColorDurationOff2()); painter->drawRect(QRect(m_startX, 0, m_minStartX - m_startX, currentHeight)); - painter->setPen(QColor(TimelineConstants::ROW_COLOR_DURATION_EDGE)); + painter->setPen(CStudioPreferences::timelineRowColorDurationEdge()); painter->drawLine(m_minStartX, 0, m_minStartX, currentHeight); } @@ -171,14 +172,14 @@ void RowTimeline::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio if (m_endX > m_maxEndX) { painter->setPen(Qt::NoPen); painter->fillRect(QRect(m_maxEndX, 0, m_endX - m_maxEndX, currentHeight), - QColor(TimelineConstants::ROW_COLOR_DURATION_OFF2)); + CStudioPreferences::timelineRowColorDurationOff2()); painter->drawRect(QRect(m_maxEndX, 0, m_endX - m_maxEndX, currentHeight)); - painter->setPen(QColor(TimelineConstants::ROW_COLOR_DURATION_EDGE)); + painter->setPen(CStudioPreferences::timelineRowColorDurationEdge()); painter->drawLine(m_maxEndX, 0, m_maxEndX, currentHeight); } if (m_rowTree->indexInLayout() != 1) { - painter->setPen(QPen(QColor(TimelineConstants::ROW_COLOR_DURATION_EDGE), 2)); + painter->setPen(QPen(CStudioPreferences::timelineRowColorDurationEdge(), 2)); painter->drawLine(m_startX, 0, m_startX, currentHeight); painter->drawLine(m_endX, 0, m_endX, currentHeight); } diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp index 7d330da3..8a0360c1 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp @@ -36,6 +36,7 @@ #include "Bindings/Qt3DSDMTimelineItemBinding.h" #include "Qt3DSString.h" #include "TreeHeader.h" +#include "StudioPreferences.h" #include #include "QtGui/qtextcursor.h" @@ -190,28 +191,28 @@ void RowTree::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q // Background QColor bgColor; if (m_dndState == DnDState::Source) - bgColor = TimelineConstants::ROW_COLOR_DND_SRC; + bgColor = CStudioPreferences::timelineRowColorDndSource(); else if (m_isProperty) - bgColor = TimelineConstants::ROW_COLOR_NORMAL_PROP; + bgColor = CStudioPreferences::timelineRowColorNormalProp(); else if (m_dndHover) - bgColor = TimelineConstants::ROW_COLOR_DND_TGT; + bgColor = CStudioPreferences::timelineRowColorDndTarget(); else if (m_state == Selected) - bgColor = TimelineConstants::ROW_COLOR_SELECTED; + bgColor = CStudioPreferences::timelineRowColorSelected(); else if (m_state == Hovered && !m_locked) - bgColor = TimelineConstants::ROW_COLOR_OVER; + bgColor = CStudioPreferences::timelineRowColorOver(); else - bgColor = TimelineConstants::ROW_COLOR_NORMAL; + bgColor = CStudioPreferences::timelineRowColorNormal(); painter->fillRect(QRect(0, 0, size().width(), size().height() - 1), bgColor); // left divider - painter->setPen(TimelineConstants::WIDGET_BG_COLOR); + painter->setPen(CStudioPreferences::timelineWidgetBgColor()); painter->drawLine(18, 0, 18, size().height() - 1); // Shy, eye, lock separator painter->fillRect(QRect(treeWidth() - TimelineConstants::TREE_ICONS_W, 0, 1, size().height()), - TimelineConstants::WIDGET_BG_COLOR); + CStudioPreferences::timelineWidgetBgColor()); // Shy, eye, lock static const QPixmap pixEmpty = QPixmap(":/images/Toggle-Empty.png"); @@ -226,7 +227,7 @@ void RowTree::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q // Candidate parent of a dragged row if (m_dndState == DnDState::Parent) { - painter->setPen(QPen(QColor(TimelineConstants::ROW_MOVER_COLOR), 1)); + painter->setPen(QPen(CStudioPreferences::timelineRowMoverColor(), 1)); painter->drawRect(QRect(1, 1, treeWidth() - 2, size().height() - 3)); } diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/Ruler.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/Ruler.cpp index be0cb878..84e8a74e 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/Ruler.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/Ruler.cpp @@ -28,6 +28,7 @@ #include "Ruler.h" #include "TimelineConstants.h" +#include "StudioPreferences.h" #include #include @@ -53,12 +54,12 @@ void Ruler::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWi double rowXMax = std::max(minRulerWidth, totalSegmentsWidth); painter->save(); - painter->setPen(QColor(TimelineConstants::RULER_COLOR_DISABLED)); + painter->setPen(CStudioPreferences::timelineRulerColorDisabled()); painter->drawLine(TimelineConstants::RULER_EDGE_OFFSET, TimelineConstants::RULER_BASE_Y, rowXMax + TimelineConstants::RULER_EDGE_OFFSET, TimelineConstants::RULER_BASE_Y); - painter->setPen(QColor(TimelineConstants::RULER_COLOR)); + painter->setPen(CStudioPreferences::timelineRulerColor()); painter->drawLine(TimelineConstants::RULER_EDGE_OFFSET, TimelineConstants::RULER_BASE_Y, activeSegmentsWidth, @@ -84,7 +85,7 @@ void Ruler::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWi TimelineConstants::RULER_DIV_H3; if (!useDisabledColor && rowX > activeSegmentsWidth) { - painter->setPen(QColor(TimelineConstants::RULER_COLOR_DISABLED)); + painter->setPen(CStudioPreferences::timelineRulerColorDisabled()); useDisabledColor = true; } painter->drawLine(QPointF(rowX, TimelineConstants::RULER_BASE_Y - h), diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/TreeHeader.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/TreeHeader.cpp index 6f597cd9..54fced3d 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/TreeHeader.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/TreeHeader.cpp @@ -27,6 +27,7 @@ ****************************************************************************/ #include "TreeHeader.h" +#include "StudioPreferences.h" #include @@ -53,8 +54,8 @@ void TreeHeader::paint(QPainter *painter, const QStyleOptionGraphicsItem *option static const QPixmap pixVisible = QPixmap(":/images/Toggle-HideShow.png"); static const QPixmap pixLock = QPixmap(":/images/Toggle-Lock.png"); - QColor selectedColor = QColor(TimelineConstants::FILTER_BUTTON_SELECTED_COLOR); - QColor hoveredColor = QColor(TimelineConstants::FILTER_BUTTON_HOVERED_COLOR); + const QColor selectedColor = CStudioPreferences::timelineFilterButtonSelectedColor(); + const QColor hoveredColor = CStudioPreferences::timelineFilterButtonHoveredColor(); if (m_shy) painter->fillRect(m_rectShy, selectedColor); -- cgit v1.2.3