mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-30 23:08:25 +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
|
||||
|
||||
// Colored marker to quickly indicate duration
|
||||
Rectangle {
|
||||
width: 4
|
||||
Item {
|
||||
Layout.minimumWidth: childrenRect.width
|
||||
Layout.fillHeight: true
|
||||
color: Colors.interpolate(Colors.grey, Colors.red, duration/180)
|
||||
}
|
||||
|
||||
// Line number
|
||||
// displays a tooltip with the duration when hovered
|
||||
Label {
|
||||
text: index + 1
|
||||
Layout.minimumWidth: lineMetrics.width
|
||||
rightPadding: 2
|
||||
Layout.fillHeight: true
|
||||
horizontalAlignment: Text.AlignRight
|
||||
color: "#CCCCCC"
|
||||
RowLayout {
|
||||
height: parent.height
|
||||
// Colored marker to quickly indicate duration
|
||||
Rectangle {
|
||||
width: 4
|
||||
Layout.fillHeight: true
|
||||
color: Colors.interpolate(Colors.grey, Colors.red, duration/180)
|
||||
}
|
||||
// Line number
|
||||
Label {
|
||||
text: index + 1
|
||||
Layout.minimumWidth: lineMetrics.width
|
||||
rightPadding: 6
|
||||
Layout.fillHeight: true
|
||||
horizontalAlignment: Text.AlignRight
|
||||
color: "#CCCCCC"
|
||||
}
|
||||
}
|
||||
// Display a tooltip with the duration when hovered
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
}
|
||||
enabled: duration > 0
|
||||
ToolTip.text: "Elapsed time: " + Format.getTimeStr(duration)
|
||||
ToolTip.visible: mouseArea.containsMouse
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue