Added clearing of selection on changing of FlatLabel selectability.

This commit is contained in:
23rd 2022-02-28 12:33:31 +03:00
parent dea62df69b
commit 73ec29fa06

View file

@ -263,8 +263,12 @@ void FlatLabel::setMarkedText(const TextWithEntities &textWithEntities) {
}
void FlatLabel::setSelectable(bool selectable) {
_selectable = selectable;
setMouseTracking(_selectable || _text.hasLinks());
if (_selectable != selectable) {
_selection = { 0, 0 };
_savedSelection = { 0, 0 };
_selectable = selectable;
setMouseTracking(_selectable || _text.hasLinks());
}
}
void FlatLabel::setDoubleClickSelectsParagraph(bool doubleClickSelectsParagraph) {