From 2cc261a1843585759362e8f89716fa5d0d1166ed Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 4 Aug 2016 11:11:54 +0200 Subject: [PATCH] QmlProfiler: Use timeline theme also for flame graph Flame graph and timeline are similar in visual appearance, so they can share theme settings. Change-Id: I2e078fd8aa55d3b21e31abc82b967093623a2ab3 Reviewed-by: Alessandro Portale --- src/plugins/qmlprofiler/flamegraphview.cpp | 6 +++++- .../qmlprofiler/qml/QmlProfilerFlameGraphView.qml | 13 +++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/plugins/qmlprofiler/flamegraphview.cpp b/src/plugins/qmlprofiler/flamegraphview.cpp index b47031ad120..33e77e7c76e 100644 --- a/src/plugins/qmlprofiler/flamegraphview.cpp +++ b/src/plugins/qmlprofiler/flamegraphview.cpp @@ -28,6 +28,8 @@ #include "qmlprofilertool.h" #include +#include +#include #include #include @@ -53,9 +55,11 @@ FlameGraphView::FlameGraphView(QmlProfilerModelManager *manager, QWidget *parent qmlRegisterUncreatableType("AbstractItemModel", 1, 0, "AbstractItemModel", QLatin1String("only for Qt 5.4")); + Timeline::TimelineTheme::setupTheme(m_content->engine()); + m_content->rootContext()->setContextProperty(QStringLiteral("flameGraphModel"), m_model); m_content->setSource(QUrl(QStringLiteral("qrc:/qmlprofiler/QmlProfilerFlameGraphView.qml"))); - m_content->setClearColor(QColor(0xdc, 0xdc, 0xdc)); + m_content->setClearColor(Utils::creatorTheme()->color(Utils::Theme::Timeline_BackgroundColor1)); m_content->setResizeMode(QQuickWidget::SizeRootObjectToView); m_content->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); diff --git a/src/plugins/qmlprofiler/qml/QmlProfilerFlameGraphView.qml b/src/plugins/qmlprofiler/qml/QmlProfilerFlameGraphView.qml index 1fe10a230f2..6ab8af2ef35 100644 --- a/src/plugins/qmlprofiler/qml/QmlProfilerFlameGraphView.qml +++ b/src/plugins/qmlprofiler/qml/QmlProfilerFlameGraphView.qml @@ -67,7 +67,7 @@ ScrollView { property color blue2: Qt.rgba(0.375, 0, 1, 1) property color grey1: "#B0B0B0" property color grey2: "#A0A0A0" - property color orange: "orange" + property color highlight: creatorTheme.Timeline_HighlightColor function checkBindingLoop(otherTypeId) {return false;} @@ -97,7 +97,7 @@ ScrollView { else if (tooltip.hoveredNode === flamegraphItem) return flamegraph.blue1; else if (note() !== "" || isBindingLoop) - return flamegraph.orange; + return flamegraph.highlight; else return flamegraph.grey1; } @@ -239,6 +239,15 @@ ScrollView { minimumY: flickable.contentY maximumY: flickable.contentY + flickable.height + titleBarColor: creatorTheme.Timeline_PanelHeaderColor + titleBarTextColor: creatorTheme.PanelTextColorLight + contentColor: creatorTheme.Timeline_PanelBackgroundColor + contentTextColor: creatorTheme.Timeline_TextColor + noteTextColor: creatorTheme.Timeline_HighlightColor + buttonHoveredColor: creatorTheme.FancyToolButtonHoverColor + buttonSelectedColor: creatorTheme.FancyToolButtonSelectedColor + borderWidth: 0 + property var hoveredNode: null; property var selectedNode: null;