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 <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-09-11 11:34:40 +02:00
parent 2b362de064
commit 8c080e909a

View File

@@ -191,23 +191,16 @@ Item {
} }
} }
Image { ToolButton {
source: expanded ? "arrow_down.png" : "arrow_right.png" id: expandButton
x: parent.width - 12 anchors.verticalCenter: txt.verticalCenter
y: 9 anchors.right: parent.right
smooth: false implicitWidth: 17
MouseArea { implicitHeight: txt.height - 1
anchors.fill: parent enabled: expanded || trigger(qmlProfilerModelProxy.count(modelIndex)) > 0
anchors.rightMargin: -10 iconSource: expanded ? "arrow_down.png" : "arrow_right.png"
anchors.leftMargin: -10 tooltip: qsTr(expanded ? "Collapse category" : "Expand category.")
anchors.topMargin: -10 onClicked: qmlProfilerModelProxy.setExpanded(modelIndex, !expanded);
anchors.bottomMargin: -10
onClicked: {
// Don't try to expand empty models.
if (expanded || qmlProfilerModelProxy.count(modelIndex) > 0)
qmlProfilerModelProxy.setExpanded(modelIndex, !expanded);
}
}
} }
Rectangle { Rectangle {