progressbar 外部属性设置没有响应处理

This commit is contained in:
tanjing 2024-02-28 15:15:59 +08:00 committed by openkylin-cibot
parent 15156640cd
commit 926480475f
2 changed files with 48 additions and 0 deletions

47
debian/patches/0034-progressbar.patch vendored Normal file
View File

@ -0,0 +1,47 @@
From: tanjing <tanjing@kylinos.cn>
Date: Wed, 28 Feb 2024 15:15:59 +0800
Subject: =?utf-8?b?cHJvZ3Jlc3NiYXIg5aSW6YOo5bGe5oCn6K6+572u5rKh5pyJ5ZON5bqU?=
=?utf-8?b?5aSE55CG?=
---
.../qt5-config-style-ukui/ukui-config-style.cpp | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/ukui-styles/qt5-config-style-ukui/ukui-config-style.cpp b/ukui-styles/qt5-config-style-ukui/ukui-config-style.cpp
index 696428a..547a01b 100644
--- a/ukui-styles/qt5-config-style-ukui/ukui-config-style.cpp
+++ b/ukui-styles/qt5-config-style-ukui/ukui-config-style.cpp
@@ -5874,8 +5874,8 @@ void UKUIConfigStyle::drawControl(QStyle::ControlElement element, const QStyleOp
{
if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
sp->initConfigProgressBarParameters(isUseDarkPalette(), pb, widget);
-
- QBrush brush = sp->m_ProgressBarParameters.progressBarContentBrush;
+ QColor progressBarContentHightColor = sp->m_ProgressBarParameters.progressBarContentHightColor;
+ QColor progressBarContentMidLightColor = sp->m_ProgressBarParameters.progressBarContentMidLightColor;
const bool vertical = pb->orientation == Qt::Vertical;
const bool inverted = pb->invertedAppearance;
@@ -5884,10 +5884,19 @@ void UKUIConfigStyle::drawControl(QStyle::ControlElement element, const QStyleOp
if (inverted)
reverse = !reverse;
- QColor progressBarContentHightColor = sp->m_ProgressBarParameters.progressBarContentHightColor;
- QColor progressBarContentMidLightColor = sp->m_ProgressBarParameters.progressBarContentMidLightColor;
-
QLinearGradient linearGradient;
+ if(vertical){
+ linearGradient.setStart(pb->rect.bottomRight());
+ linearGradient.setFinalStop(pb->rect.topLeft());
+ }
+ else{
+ linearGradient.setStart(pb->rect.topLeft());
+ linearGradient.setFinalStop(pb->rect.bottomRight());
+ }
+ linearGradient.setColorAt(0, progressBarContentMidLightColor);
+ linearGradient.setColorAt(1, progressBarContentHightColor);
+ QBrush brush(linearGradient);
+
if (QVariantAnimation *animation = m_animation_helper->animation(option->styleObject)) {
if(animation->state() == QAbstractAnimation::Running){
bool forward = animation->direction() == QAbstractAnimation::Forward;

View File

@ -31,3 +31,4 @@
0031-test.patch
0032-Update-changelog-4.1.0.0-0k31.patch
0033-Remove-gitignore.patch
0034-progressbar.patch