From 20af0711d524a8988465e4ce9f716515398243a8 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 21 Mar 2023 12:35:38 +0100 Subject: 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 --- src/libs/tracing/qml/CategoryLabel.qml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/libs/tracing') diff --git a/src/libs/tracing/qml/CategoryLabel.qml b/src/libs/tracing/qml/CategoryLabel.qml index 4226195cbba..58704aa175a 100644 --- a/src/libs/tracing/qml/CategoryLabel.qml +++ b/src/libs/tracing/qml/CategoryLabel.qml @@ -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,16 +185,13 @@ 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: [ -- cgit v1.2.3