From 84a024ae6a9ce9911252f19ccd24f07b08d26ec2 Mon Sep 17 00:00:00 2001 From: Pablo Gil Date: Sat, 3 Jan 2026 16:23:24 +0100 Subject: [PATCH 1/2] fix actual color preview for colorAnimatorButton at timeline parameters --- src/core/GUI/coloranimatorbutton.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/GUI/coloranimatorbutton.cpp b/src/core/GUI/coloranimatorbutton.cpp index 3d79e1e9f..17ff9998b 100644 --- a/src/core/GUI/coloranimatorbutton.cpp +++ b/src/core/GUI/coloranimatorbutton.cpp @@ -73,6 +73,7 @@ void ColorAnimatorButton::paintEvent(QPaintEvent *) { QPainter p(this); + const QColor currentColor = color(); const QRectF rect(0.0, 0.0, width(), height()); const float borderWidth = 2.0; const QRectF innerRect = rect.adjusted(borderWidth, @@ -81,19 +82,19 @@ void ColorAnimatorButton::paintEvent(QPaintEvent *) -borderWidth); if (mHover) { - const QColor color = ThemeSupport::getLightDarkColor(mColor, 130); + const QColor color = ThemeSupport::getLightDarkColor(currentColor, 130); p.setPen(color); p.setBrush(color); p.drawRoundedRect(rect, borderWidth + 2, borderWidth + 2); - p.setBrush(mColor); + p.setBrush(currentColor); p.drawRoundedRect(innerRect, borderWidth, borderWidth); } else { - p.setPen(mColor); - p.setBrush(mColor); + p.setPen(currentColor); + p.setBrush(currentColor); p.drawRoundedRect(rect, borderWidth + 2, borderWidth + 2); From dfedd9d499bdd27b54d710051a43b91900a0ae4d Mon Sep 17 00:00:00 2001 From: Pablo Gil Date: Sat, 3 Jan 2026 16:46:07 +0100 Subject: [PATCH 2/2] make colorAnimatorButton match other widgets width --- src/app/GUI/BoxesList/boxsinglewidget.cpp | 4 ++-- src/core/GUI/coloranimatorbutton.cpp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/GUI/BoxesList/boxsinglewidget.cpp b/src/app/GUI/BoxesList/boxsinglewidget.cpp index 8c53bd7b6..da05019aa 100644 --- a/src/app/GUI/BoxesList/boxsinglewidget.cpp +++ b/src/app/GUI/BoxesList/boxsinglewidget.cpp @@ -264,8 +264,8 @@ BoxSingleWidget::BoxSingleWidget(BoxScroller * const parent) mColorButton = new ColorAnimatorButton(nullptr, this); mMainLayout->addWidget(mColorButton, Qt::AlignRight); - mColorButton->setFixedHeight(mColorButton->height() - 6); - mColorButton->setContentsMargins(0, 3, 0, 3); + mColorButton->setFixedHeight(mColorButton->height() - 2); + mColorButton->setContentsMargins(0, 1, 0, 1); mPropertyComboBox = createCombo(this); mMainLayout->addWidget(mPropertyComboBox); diff --git a/src/core/GUI/coloranimatorbutton.cpp b/src/core/GUI/coloranimatorbutton.cpp index 17ff9998b..3749f9eb9 100644 --- a/src/core/GUI/coloranimatorbutton.cpp +++ b/src/core/GUI/coloranimatorbutton.cpp @@ -36,6 +36,10 @@ ColorAnimatorButton::ColorAnimatorButton(QWidget * const parent) { connect(this, &BoxesListActionButton::pressed, this, &ColorAnimatorButton::openColorSettingsDialog); + eSizesUI::widget.add(this, [this](const int size) { + setFixedHeight(size); + setFixedWidth(size * 3 - 2); + }); } ColorAnimatorButton::ColorAnimatorButton(ColorAnimator * const colorTarget,