Tracing: Fix category label appearance after manual reordering

The drag item remained visible although the item height was supposedly
set to 0. This fix uses the visibility property in order to show/hide
the drag item.

Fixes: QTCREATORBUG-28930
Change-Id: I2233eed585f94eab5d71e0aa2743b791390c249c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Alessandro Portale
2023-03-21 12:35:38 +01:00
parent 9ddd1e1d36
commit 20af0711d5

View File

@@ -174,9 +174,10 @@ Item {
id: dragger
property int visualIndex: labelContainer.visualIndex
width: labelContainer.width
height: 0
height: labelContainer.height
color: Theme.color(Theme.PanelStatusBarBackgroundColor)
opacity: 0.5
visible: Drag.active
anchors.left: parent.left
// anchor to top so that it reliably snaps back after dragging
@@ -184,17 +185,14 @@ Item {
Drag.active: dragArea.drag.active
Drag.onActiveChanged: {
// We don't want height or text to be changed when reordering occurs, so we don't make
// them properties.
// We don't want text to be changed when reordering occurs, so we don't make
// it a property
draggerText.text = txt.text;
if (Drag.active) {
height = labelContainer.height;
if (Drag.active)
labelContainer.dragStarted();
} else {
height = 0;
else
labelContainer.dragStopped();
}
}
states: [
State {