2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2015-01-15 12:34:19 +01:00
|
|
|
|
2022-07-17 13:43:49 +02:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import QtCreator.Tracing
|
2015-01-15 12:34:19 +01:00
|
|
|
|
|
|
|
|
Button {
|
|
|
|
|
id: button
|
|
|
|
|
property var label
|
|
|
|
|
|
|
|
|
|
readonly property int dragHeight: 5
|
|
|
|
|
|
|
|
|
|
signal selectBySelectionId()
|
|
|
|
|
signal setRowHeight(int newHeight)
|
|
|
|
|
|
2022-09-01 13:23:10 +02:00
|
|
|
property string labelText: label.description ? label.description
|
2023-01-24 13:29:53 +01:00
|
|
|
: qsTranslate("::Tracing", "[unknown]")
|
2019-06-28 11:33:06 +02:00
|
|
|
|
|
|
|
|
onPressed: selectBySelectionId();
|
|
|
|
|
ToolTip.text: labelText + (label.displayName ? (" (" + label.displayName + ")") : "")
|
|
|
|
|
ToolTip.visible: hovered
|
|
|
|
|
ToolTip.delay: 1000
|
|
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
|
border.width: 1
|
|
|
|
|
border.color: Theme.color(Theme.Timeline_DividerColor)
|
|
|
|
|
color: Theme.color(Theme.PanelStatusBarBackgroundColor)
|
2015-01-15 12:34:19 +01:00
|
|
|
}
|
|
|
|
|
|
2019-06-28 11:33:06 +02:00
|
|
|
contentItem: TimelineText {
|
|
|
|
|
text: button.labelText
|
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
|
horizontalAlignment: Text.AlignLeft
|
|
|
|
|
elide: Text.ElideRight
|
|
|
|
|
color: Theme.color(Theme.PanelTextColorLight)
|
2015-01-15 12:34:19 +01:00
|
|
|
}
|
2019-06-28 11:33:06 +02:00
|
|
|
|
2015-01-15 12:34:19 +01:00
|
|
|
MouseArea {
|
|
|
|
|
hoverEnabled: true
|
|
|
|
|
property bool resizing: false
|
|
|
|
|
onPressed: resizing = true
|
|
|
|
|
onReleased: resizing = false
|
|
|
|
|
|
2022-10-14 13:30:50 +02:00
|
|
|
height: button.dragHeight
|
2015-01-15 12:34:19 +01:00
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
cursorShape: Qt.SizeVerCursor
|
|
|
|
|
|
|
|
|
|
onMouseYChanged: {
|
|
|
|
|
if (resizing)
|
|
|
|
|
button.setRowHeight(y + mouseY)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|