From 8081ab134b4e7df1cc67f46c70c1c894d5a379af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fauconnier?= Date: Tue, 30 Jul 2019 14:57:25 +0200 Subject: [PATCH] fix an issue where the text could be in interaction mode without being selected --- src/domain/UBGraphicsTextItem.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/domain/UBGraphicsTextItem.cpp b/src/domain/UBGraphicsTextItem.cpp index 7282eff9..5a96dff6 100644 --- a/src/domain/UBGraphicsTextItem.cpp +++ b/src/domain/UBGraphicsTextItem.cpp @@ -253,13 +253,15 @@ void UBGraphicsTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem QGraphicsTextItem::paint(painter, &styleOption, widget); - if (widget == UBApplication::boardController->controlView()->viewport() && - !isSelected() && toPlainText().isEmpty()) + if (widget == UBApplication::boardController->controlView()->viewport() && !isSelected()) { - painter->setFont(font()); - painter->setPen(UBSettings::paletteColor); - painter->drawText(boundingRect(), Qt::AlignCenter, mTypeTextHereLabel); setTextInteractionFlags(Qt::NoTextInteraction); + if (toPlainText().isEmpty()) + { + painter->setFont(font()); + painter->setPen(UBSettings::paletteColor); + painter->drawText(boundingRect(), Qt::AlignCenter, mTypeTextHereLabel); + } } Delegate()->postpaint(painter, option, widget);