Skip to content

Commit 0753cd0

Browse files
committed
Update coloranimatorbutton.cpp
Fix regression introduced in 6dfd777 Ref: #679 (comment) and #681
1 parent 26825a9 commit 0753cd0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/core/GUI/coloranimatorbutton.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ void ColorAnimatorButton::setColorTarget(ColorAnimator * const target)
7171

7272
void ColorAnimatorButton::paintEvent(QPaintEvent *)
7373
{
74+
const QColor color = mColorTarget ? mColorTarget->getColor() : mColor;
7475
QPainter p(this);
7576

7677
const QRectF rect(0.0, 0.0, width(), height());
@@ -81,19 +82,19 @@ void ColorAnimatorButton::paintEvent(QPaintEvent *)
8182
-borderWidth);
8283

8384
if (mHover) {
84-
const QColor color = ThemeSupport::getLightDarkColor(mColor, 130);
85-
p.setPen(color);
86-
p.setBrush(color);
85+
const QColor altColor = ThemeSupport::getLightDarkColor(color, 130);
86+
p.setPen(altColor);
87+
p.setBrush(altColor);
8788
p.drawRoundedRect(rect,
8889
borderWidth + 2,
8990
borderWidth + 2);
90-
p.setBrush(mColor);
91+
p.setBrush(color);
9192
p.drawRoundedRect(innerRect,
9293
borderWidth,
9394
borderWidth);
9495
} else {
95-
p.setPen(mColor);
96-
p.setBrush(mColor);
96+
p.setPen(color);
97+
p.setBrush(color);
9798
p.drawRoundedRect(rect,
9899
borderWidth + 2,
99100
borderWidth + 2);

0 commit comments

Comments
 (0)