Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
06a5cb12
Commit
06a5cb12
authored
May 17, 2021
by
Julius Künzel
⚠
Browse files
Fix effect sliders on right to left (rtl) layouts
BUG: 434981
parent
6defcfd5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/widgets/dragvalue.cpp
View file @
06a5cb12
...
...
@@ -463,6 +463,9 @@ void CustomLabel::mouseMoveEvent(QMouseEvent *e)
if
(
m_dragMode
)
{
if
(
KdenliveSettings
::
dragvalue_mode
()
>
0
||
!
m_showSlider
)
{
int
diff
=
e
->
x
()
-
m_dragLastPosition
.
x
();
if
(
qApp
->
isRightToLeft
())
{
diff
=
0
-
diff
;
}
if
(
e
->
modifiers
()
==
Qt
::
ControlModifier
)
{
diff
*=
2
;
...
...
@@ -477,7 +480,12 @@ void CustomLabel::mouseMoveEvent(QMouseEvent *e)
setNewValue
(
nv
,
KdenliveSettings
::
dragvalue_directupdate
());
}
}
else
{
double
nv
=
minimum
()
+
((
double
)
maximum
()
-
minimum
())
/
width
()
*
e
->
pos
().
x
();
double
nv
;
if
(
qApp
->
isLeftToRight
())
{
nv
=
minimum
()
+
((
double
)
maximum
()
-
minimum
())
/
width
()
*
e
->
pos
().
x
();
}
else
{
nv
=
maximum
()
-
((
double
)
maximum
()
-
minimum
())
/
width
()
*
e
->
pos
().
x
();
}
if
(
!
qFuzzyCompare
(
nv
,
value
()))
{
if
(
m_step
>
1
)
{
int
current
=
(
int
)
value
();
...
...
@@ -512,13 +520,16 @@ void CustomLabel::mouseReleaseEvent(QMouseEvent *e)
m_dragLastPosition
=
m_dragStartPosition
;
e
->
accept
();
}
else
if
(
m_showSlider
)
{
int
newVal
=
(
double
)
maximum
()
*
e
->
pos
().
x
()
/
width
();
if
(
qApp
->
isRightToLeft
())
{
newVal
=
maximum
()
-
newVal
;
}
if
(
m_step
>
1
)
{
int
current
=
(
int
)
value
();
int
newVal
=
(
double
)
maximum
()
*
e
->
pos
().
x
()
/
width
();
int
diff
=
(
newVal
-
current
)
/
m_step
;
setNewValue
(
current
+
diff
*
m_step
,
true
);
}
else
{
setNewValue
(
(
double
)
maximum
()
*
e
->
pos
().
x
()
/
width
()
,
true
);
setNewValue
(
newVal
,
true
);
}
m_dragLastPosition
=
m_dragStartPosition
;
e
->
accept
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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