From 8c080e909a01d1cf35d9afc33af4f0e078bd321c Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 11 Sep 2014 11:34:40 +0200 Subject: [PATCH] QmlProfiler: Make timeline expand buttons actual Button items It looks better, both in the code and in the result. Change-Id: I5d24b24de429fb6a6d15c2df97f977924bb9fb00 Reviewed-by: Kai Koehne --- src/plugins/qmlprofiler/qml/CategoryLabel.qml | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/src/plugins/qmlprofiler/qml/CategoryLabel.qml b/src/plugins/qmlprofiler/qml/CategoryLabel.qml index 66bbe7eff1f..81e961ebcc1 100644 --- a/src/plugins/qmlprofiler/qml/CategoryLabel.qml +++ b/src/plugins/qmlprofiler/qml/CategoryLabel.qml @@ -191,23 +191,16 @@ Item { } } - Image { - source: expanded ? "arrow_down.png" : "arrow_right.png" - x: parent.width - 12 - y: 9 - smooth: false - MouseArea { - anchors.fill: parent - anchors.rightMargin: -10 - anchors.leftMargin: -10 - anchors.topMargin: -10 - anchors.bottomMargin: -10 - onClicked: { - // Don't try to expand empty models. - if (expanded || qmlProfilerModelProxy.count(modelIndex) > 0) - qmlProfilerModelProxy.setExpanded(modelIndex, !expanded); - } - } + ToolButton { + id: expandButton + anchors.verticalCenter: txt.verticalCenter + anchors.right: parent.right + implicitWidth: 17 + implicitHeight: txt.height - 1 + enabled: expanded || trigger(qmlProfilerModelProxy.count(modelIndex)) > 0 + iconSource: expanded ? "arrow_down.png" : "arrow_right.png" + tooltip: qsTr(expanded ? "Collapse category" : "Expand category.") + onClicked: qmlProfilerModelProxy.setExpanded(modelIndex, !expanded); } Rectangle {