From e92a3d69602ead57d6aa6c49ee99dcb2f58ddce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole-Andr=C3=A9=20Rodlie?= Date: Sat, 31 Aug 2024 17:51:08 +0200 Subject: [PATCH] Graph: better UX for selected/hover point(s) #163 --- src/core/Animators/qrealpoint.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/core/Animators/qrealpoint.cpp b/src/core/Animators/qrealpoint.cpp index acdf41e3a..bdef31681 100644 --- a/src/core/Animators/qrealpoint.cpp +++ b/src/core/Animators/qrealpoint.cpp @@ -159,13 +159,15 @@ void QrealPoint::draw(QPainter * const p, if (mHovered) { gDrawCosmeticEllipse(p, center, mRadius + 1, mRadius + 1); } else { gDrawCosmeticEllipse(p, center, mRadius, mRadius); } - - //p->setBrush(paintColor); - p->setBrush(Qt::white); - - if (!isSelected()) { p->setBrush(/*paintColor.lighter()*/Qt::gray); } + if (isSelected() || mHovered) { p->setBrush(Qt::white); } + else { p->setBrush(Qt::gray); } gDrawCosmeticEllipse(p, center, mRadius - 1, mRadius - 1); + + if (isSelected() || mHovered) { + p->setBrush(paintColor); + gDrawCosmeticEllipse(p, center, mRadius/2 - 1, mRadius/2 - 1); + } } void QrealPoint::setSelected(const bool selected) {