Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Breeze visual style
Commits
b5131626
Commit
b5131626
authored
Jun 04, 2022
by
ivan tkachenko
Committed by
Nate Graham
Jun 13, 2022
Browse files
KStyle: Fix QQC2 ProgressBar desktop style in RTL layout direction
BUG: 430101
(cherry picked from commit
2bf9fc4c
)
parent
cbac3c9e
Pipeline
#190380
failed with stage
in 2 minutes and 33 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
kstyle/breezestyle.cpp
View file @
b5131626
...
...
@@ -1902,23 +1902,27 @@ QRect Style::progressBarContentsRect(const QStyleOption *option, const QWidget *
const
bool
horizontal
(
BreezePrivate
::
isProgressBarHorizontal
(
progressBarOption
));
// check inverted appearance
const
bool
inverted
(
progressBarOption
->
invertedAppearance
);
bool
inverted
(
progressBarOption
->
invertedAppearance
);
if
(
horizontal
)
{
// un-invert in RTL layout
inverted
^=
option
->
direction
==
Qt
::
RightToLeft
;
}
// get progress and steps
const
qreal
progress
(
progressBarOption
->
progress
-
progressBarOption
->
minimum
);
const
int
progress
(
progressBarOption
->
progress
-
progressBarOption
->
minimum
);
const
int
steps
(
qMax
(
progressBarOption
->
maximum
-
progressBarOption
->
minimum
,
1
));
// Calculate width fraction
const
qreal
widthFrac
=
qMin
(
qreal
(
1
),
progress
/
steps
);
const
qreal
position
=
qreal
(
progress
)
/
qreal
(
steps
);
const
qreal
visualPosition
=
inverted
?
1
-
position
:
position
;
// convert the pixel width
const
int
indicatorSize
(
widthFrac
*
(
horizontal
?
rect
.
width
()
:
rect
.
height
()));
const
int
indicatorSize
(
visualPosition
*
(
horizontal
?
rect
.
width
()
:
rect
.
height
()));
QRect
indicatorRect
;
if
(
horizontal
)
{
indicatorRect
=
QRect
(
inverted
?
(
rect
.
right
()
-
indicatorSize
+
1
)
:
rect
.
left
(),
rect
.
y
(),
indicatorSize
,
rect
.
height
());
indicatorRect
=
QRect
(
rect
.
left
(),
rect
.
y
(),
indicatorSize
,
rect
.
height
());
indicatorRect
=
visualRect
(
option
->
direction
,
rect
,
indicatorRect
);
}
else
indicatorRect
=
QRect
(
rect
.
x
(),
inverted
?
rect
.
top
()
:
(
rect
.
bottom
()
-
indicatorSize
+
1
),
rect
.
width
(),
indicatorSize
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment