From e53f6ed2921843a3c10de88d67e6bab1229cce52 Mon Sep 17 00:00:00 2001 From: miruka Date: Wed, 11 Sep 2019 15:42:48 -0400 Subject: [PATCH] Fix selection disappearing after delegates unload Make delegates update their selection when they're loaded again. --- TODO.md | 4 ++++ src/qml/Base/HSelectableLabel.qml | 2 ++ src/qml/Base/HSelectableLabelContainer.qml | 1 + 3 files changed, 7 insertions(+) diff --git a/TODO.md b/TODO.md index 46af6d15..4ae7225b 100644 --- a/TODO.md +++ b/TODO.md @@ -13,6 +13,10 @@ - When qml syntax highlighting supports ES6 string interpolation, use that - Fixes + - Time on their own lines + - When selecting text and scrolling up, selection stops working after a while + - Ensure all the text that should be copied is copied + - Missing members pane right padding - Pressing backspace in composer sometimes doesn't work - Message order isn't preserved when sending a first message in a E2E diff --git a/src/qml/Base/HSelectableLabel.qml b/src/qml/Base/HSelectableLabel.qml index 0baf561f..4fba2555 100644 --- a/src/qml/Base/HSelectableLabel.qml +++ b/src/qml/Base/HSelectableLabel.qml @@ -18,6 +18,8 @@ TextEdit { onLinkActivated: Qt.openUrlExternally(link) + Component.onCompleted: updateSelection() + // If index is a whole number, the label will get two \n before itself // in container.joinedSelection. If it's a decimal number, if gets one \n. diff --git a/src/qml/Base/HSelectableLabelContainer.qml b/src/qml/Base/HSelectableLabelContainer.qml index ae425efb..0309128f 100644 --- a/src/qml/Base/HSelectableLabelContainer.qml +++ b/src/qml/Base/HSelectableLabelContainer.qml @@ -82,5 +82,6 @@ FocusScope { onTapped: clearSelection() } + // This item will trigger the children labels's DropAreas Item { id: draggedItem } }