mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-03 16:58:24 +02:00
[ui] Node: add selected property + selection border
* use more efficient selection border instead of slightly changing header's color * require activeFocus when selected
This commit is contained in:
parent
06f3d140df
commit
e6e2c18aa8
2 changed files with 14 additions and 1 deletions
|
@ -267,7 +267,8 @@ Item {
|
|||
node: object
|
||||
width: uigraph.layout.nodeWidth
|
||||
readOnly: root.readOnly
|
||||
baseColor: root.selectedNode == node ? Qt.lighter(defaultColor, 1.2) : defaultColor
|
||||
selected: root.selectedNode == node
|
||||
onSelectedChanged: if(selected) forceActiveFocus()
|
||||
|
||||
onAttributePinCreated: registerAttributePin(attribute, pin)
|
||||
onAttributePinDeleted: unregisterAttributePin(attribute, pin)
|
||||
|
|
|
@ -12,6 +12,7 @@ Item {
|
|||
property color shadowColor: "black"
|
||||
readonly property bool isCompatibilityNode: node.hasOwnProperty("compatibilityIssue")
|
||||
readonly property color defaultColor: isCompatibilityNode ? "#444" : "#607D8B"
|
||||
property bool selected: false
|
||||
|
||||
signal pressed(var mouse)
|
||||
signal doubleClicked(var mouse)
|
||||
|
@ -52,6 +53,17 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
// Selection border
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: -border.width
|
||||
visible: root.selected
|
||||
border.width: 2.5
|
||||
border.color: activePalette.highlight
|
||||
opacity: 0.9
|
||||
color: "transparent"
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: background
|
||||
anchors.fill: parent
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue