Verified Commit 3cf4f4f7 authored by ivan tkachenko's avatar ivan tkachenko
Browse files

KStyle: Reuse existing local const variable

parent 4ac91324
Pipeline #185796 passed with stage
in 2 minutes and 34 seconds
......@@ -5164,6 +5164,8 @@ bool Style::drawProgressBarControl(const QStyleOption *option, QPainter *painter
const QObject *styleObject(widget ? widget : progressBarOption->styleObject);
const bool busy(progressBarOption->minimum == 0 && progressBarOption->maximum == 0);
// enable busy animations
// need to check both widget and passed styleObject, used for QML
if (styleObject && _animations->busyIndicatorEngine().enabled()) {
......@@ -5172,7 +5174,7 @@ bool Style::drawProgressBarControl(const QStyleOption *option, QPainter *painter
_animations->busyIndicatorEngine().registerWidget(progressBarOption->styleObject);
}
_animations->busyIndicatorEngine().setAnimated(styleObject, progressBarOption->maximum == 0 && progressBarOption->minimum == 0);
_animations->busyIndicatorEngine().setAnimated(styleObject, busy);
}
// check if animated and pass to option
......@@ -5186,7 +5188,6 @@ bool Style::drawProgressBarControl(const QStyleOption *option, QPainter *painter
// render text
const bool textVisible(progressBarOption->textVisible);
const bool busy(progressBarOption->minimum == 0 && progressBarOption->maximum == 0);
if (textVisible && !busy) {
progressBarOption2.rect = subElementRect(SE_ProgressBarLabel, progressBarOption, widget);
drawControl(CE_ProgressBarLabel, &progressBarOption2, painter, widget);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment