forked from openkylin/qt5-ukui-platformtheme
progressbar 外部属性设置没有响应处理
This commit is contained in:
parent
15156640cd
commit
926480475f
|
@ -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;
|
|
@ -31,3 +31,4 @@
|
|||
0031-test.patch
|
||||
0032-Update-changelog-4.1.0.0-0k31.patch
|
||||
0033-Remove-gitignore.patch
|
||||
0034-progressbar.patch
|
||||
|
|
Loading…
Reference in New Issue