forked from qt-creator/qt-creator
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 <alessandro.portale@qt.io>
This commit is contained in:
@@ -28,6 +28,8 @@
|
|||||||
#include "qmlprofilertool.h"
|
#include "qmlprofilertool.h"
|
||||||
|
|
||||||
#include <flamegraph/flamegraph.h>
|
#include <flamegraph/flamegraph.h>
|
||||||
|
#include <timeline/timelinetheme.h>
|
||||||
|
#include <utils/theme/theme.h>
|
||||||
|
|
||||||
#include <QQmlEngine>
|
#include <QQmlEngine>
|
||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
@@ -53,9 +55,11 @@ FlameGraphView::FlameGraphView(QmlProfilerModelManager *manager, QWidget *parent
|
|||||||
qmlRegisterUncreatableType<QAbstractItemModel>("AbstractItemModel", 1, 0, "AbstractItemModel",
|
qmlRegisterUncreatableType<QAbstractItemModel>("AbstractItemModel", 1, 0, "AbstractItemModel",
|
||||||
QLatin1String("only for Qt 5.4"));
|
QLatin1String("only for Qt 5.4"));
|
||||||
|
|
||||||
|
Timeline::TimelineTheme::setupTheme(m_content->engine());
|
||||||
|
|
||||||
m_content->rootContext()->setContextProperty(QStringLiteral("flameGraphModel"), m_model);
|
m_content->rootContext()->setContextProperty(QStringLiteral("flameGraphModel"), m_model);
|
||||||
m_content->setSource(QUrl(QStringLiteral("qrc:/qmlprofiler/QmlProfilerFlameGraphView.qml")));
|
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->setResizeMode(QQuickWidget::SizeRootObjectToView);
|
||||||
m_content->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
m_content->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ ScrollView {
|
|||||||
property color blue2: Qt.rgba(0.375, 0, 1, 1)
|
property color blue2: Qt.rgba(0.375, 0, 1, 1)
|
||||||
property color grey1: "#B0B0B0"
|
property color grey1: "#B0B0B0"
|
||||||
property color grey2: "#A0A0A0"
|
property color grey2: "#A0A0A0"
|
||||||
property color orange: "orange"
|
property color highlight: creatorTheme.Timeline_HighlightColor
|
||||||
|
|
||||||
function checkBindingLoop(otherTypeId) {return false;}
|
function checkBindingLoop(otherTypeId) {return false;}
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ ScrollView {
|
|||||||
else if (tooltip.hoveredNode === flamegraphItem)
|
else if (tooltip.hoveredNode === flamegraphItem)
|
||||||
return flamegraph.blue1;
|
return flamegraph.blue1;
|
||||||
else if (note() !== "" || isBindingLoop)
|
else if (note() !== "" || isBindingLoop)
|
||||||
return flamegraph.orange;
|
return flamegraph.highlight;
|
||||||
else
|
else
|
||||||
return flamegraph.grey1;
|
return flamegraph.grey1;
|
||||||
}
|
}
|
||||||
@@ -239,6 +239,15 @@ ScrollView {
|
|||||||
minimumY: flickable.contentY
|
minimumY: flickable.contentY
|
||||||
maximumY: flickable.contentY + flickable.height
|
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 hoveredNode: null;
|
||||||
property var selectedNode: null;
|
property var selectedNode: null;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user