mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-13 00:02:43 +02:00
[ui] Display for loop size on edges
This commit is contained in:
parent
1f995c23d6
commit
aba045f4aa
3 changed files with 14 additions and 17 deletions
|
@ -18,6 +18,7 @@ Item {
|
|||
property alias thickness: path.strokeWidth
|
||||
property alias color: path.strokeColor
|
||||
property bool isForLoop: false
|
||||
property int loopSize: 0
|
||||
property int iteration: 0
|
||||
|
||||
// BUG: edgeArea is destroyed before path, need to test if not null to avoid warnings
|
||||
|
@ -82,25 +83,17 @@ Item {
|
|||
height: childrenRect.height + 2 * margin
|
||||
radius: width
|
||||
color: path.strokeColor
|
||||
MaterialLabel {
|
||||
MaterialToolLabel {
|
||||
id: icon
|
||||
x: parent.margin
|
||||
y: parent.margin
|
||||
text: MaterialIcons.loop
|
||||
iconText: MaterialIcons.loop
|
||||
label: (root.iteration + 1) + "/" + root.loopSize
|
||||
|
||||
color: palette.base
|
||||
font.pointSize: 24
|
||||
|
||||
ToolTip.text: "This is a for loop"
|
||||
}
|
||||
|
||||
Label {
|
||||
x: icon.width / 2.4
|
||||
y: icon.height / 3
|
||||
font.pixelSize: 10
|
||||
text: root.iteration
|
||||
color: palette.base
|
||||
font.bold: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -411,14 +411,16 @@ Item {
|
|||
anchors.top: listAttrMenuText.bottom
|
||||
anchors.horizontalCenter: listAttrColumn.horizontalCenter
|
||||
visible: edgeMenu.currentEdge && edgeMenu.forLoop
|
||||
value: listAttrColumn.listAttr ? listAttrColumn.listAttr.value.indexOf(edgeMenu.currentEdge.src) : 0
|
||||
range: { "min": 0, "max": listAttrColumn.listAttr ? listAttrColumn.listAttr.value.count - 1 : 0 }
|
||||
|
||||
// We add 1 to the index because of human readable index (starting at 1)
|
||||
value: listAttrColumn.listAttr ? listAttrColumn.listAttr.value.indexOf(edgeMenu.currentEdge.src) + 1 : 0
|
||||
range: { "min": 1, "max": listAttrColumn.listAttr ? listAttrColumn.listAttr.value.count : 0 }
|
||||
|
||||
onValueChanged: {
|
||||
if (listAttrColumn.listAttr === null) {
|
||||
return
|
||||
}
|
||||
const newSrcAttr = listAttrColumn.listAttr.value.at(value)
|
||||
const newSrcAttr = listAttrColumn.listAttr.value.at(value - 1)
|
||||
const dst = edgeMenu.currentEdge.dst
|
||||
|
||||
// if the edge exists do not replace it
|
||||
|
@ -499,6 +501,7 @@ Item {
|
|||
|
||||
edge: object
|
||||
isForLoop: forLoop
|
||||
loopSize: forLoop ? edge.src.root.value.count : 0
|
||||
iteration: forLoop ? edge.src.root.value.indexOf(edge.src) : 0
|
||||
color: edge.dst === root.edgeAboutToBeRemoved ? "red" : inFocus ? activePalette.highlight : activePalette.text
|
||||
thickness: (forLoop && inFocus) ? 3 : (forLoop || inFocus) ? 2 : 1
|
||||
|
|
|
@ -12,6 +12,7 @@ Item {
|
|||
property alias iconText: iconItem.text
|
||||
property alias iconSize: iconItem.font.pointSize
|
||||
property alias label: labelItem.text
|
||||
property var color: palette.text
|
||||
implicitWidth: childrenRect.width
|
||||
implicitHeight: childrenRect.height
|
||||
anchors.rightMargin: 5
|
||||
|
@ -23,12 +24,12 @@ Item {
|
|||
font.pointSize: 13
|
||||
padding: 0
|
||||
text: ""
|
||||
color: palette.text
|
||||
color: color
|
||||
}
|
||||
Label {
|
||||
id: labelItem
|
||||
text: ""
|
||||
color: palette.text
|
||||
color: color
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue