mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-06 10:18:42 +02:00
[ui] show tooltip when hovering over line number or color bar
This commit is contained in:
parent
f4b8cb080d
commit
3e2478bd24
1 changed files with 26 additions and 20 deletions
|
@ -199,30 +199,36 @@ Item {
|
||||||
|
|
||||||
property var duration: textView.model.get(index).duration
|
property var duration: textView.model.get(index).duration
|
||||||
|
|
||||||
|
Item {
|
||||||
|
Layout.minimumWidth: childrenRect.width
|
||||||
|
Layout.fillHeight: true
|
||||||
|
RowLayout {
|
||||||
|
height: parent.height
|
||||||
// Colored marker to quickly indicate duration
|
// Colored marker to quickly indicate duration
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: 4
|
width: 4
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
color: Colors.interpolate(Colors.grey, Colors.red, duration/180)
|
color: Colors.interpolate(Colors.grey, Colors.red, duration/180)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Line number
|
// Line number
|
||||||
// displays a tooltip with the duration when hovered
|
|
||||||
Label {
|
Label {
|
||||||
text: index + 1
|
text: index + 1
|
||||||
Layout.minimumWidth: lineMetrics.width
|
Layout.minimumWidth: lineMetrics.width
|
||||||
rightPadding: 2
|
rightPadding: 6
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
horizontalAlignment: Text.AlignRight
|
horizontalAlignment: Text.AlignRight
|
||||||
color: "#CCCCCC"
|
color: "#CCCCCC"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Display a tooltip with the duration when hovered
|
||||||
|
MouseArea {
|
||||||
|
id: mouseArea
|
||||||
|
hoverEnabled: true
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
enabled: duration > 0
|
enabled: duration > 0
|
||||||
ToolTip.text: "Elapsed time: " + Format.getTimeStr(duration)
|
ToolTip.text: "Elapsed time: " + Format.getTimeStr(duration)
|
||||||
ToolTip.visible: mouseArea.containsMouse
|
ToolTip.visible: mouseArea.containsMouse
|
||||||
MouseArea {
|
|
||||||
id: mouseArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue