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
2bf9fc4c
Commit
2bf9fc4c
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
parent
c12028c5
Pipeline
#190377
passed with stage
in 3 minutes and 3 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
kstyle/breezestyle.cpp
View file @
2bf9fc4c
...
...
@@ -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
);
...
...
ivan tkachenko
@ratijas
mentioned in commit
b5131626
·
Jun 13, 2022
mentioned in commit
b5131626
mentioned in commit b51316269ff02c84648667df97563bacd2538b6c
Toggle commit list
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