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
d41fb202
Commit
d41fb202
authored
Jan 01, 2022
by
Julius Künzel
Browse files
[Timeline Zoombar] More improvements
parent
06107cab
Pipeline
#117006
passed with stage
in 7 minutes and 28 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/qml/ZoomBar.qml
View file @
d41fb202
...
...
@@ -53,9 +53,9 @@ Rectangle {
id
:
zoomBar
height
:
parent
.
height
property
int
minWidth
:
barMinWidth
+
zoomEnd
.
width
+
zoomStart
.
width
property
int
preferedWidth
:
root
.
zoomBarWidth
*
zoomHandleContainer
.
width
property
int
preferedWidth
:
scrollView
.
visibleArea
.
widthRatio
*
zoomHandleContainer
.
width
width
:
!
zoomStart
.
pressed
&&
!
zoomEnd
.
pressed
&&
preferedWidth
<
minWidth
?
minWidth
:
preferedWidth
x
:
root
.
zoomStart
*
zoomHandleContainer
.
width
x
:
scrollView
.
visibleArea
.
xPosition
*
zoomHandleContainer
.
width
MouseArea
{
id
:
barArea
anchors.fill
:
parent
...
...
@@ -99,9 +99,11 @@ Rectangle {
MouseArea
{
id
:
zoomStart
property
bool
isActive
:
zoomStart
.
containsMouse
||
zoomStart
.
pressed
anchors.right
:
pressed
?
undefined
:
zoomBar
.
left
anchors.rightMargin
:
-
width
anchors.bottom
:
zoomBar
.
bottom
anchors
{
right
:
pressed
?
undefined
:
zoomBar
.
left
rightMargin
:
-
width
bottom
:
zoomBar
.
bottom
}
width
:
zoomBar
.
height
height
:
zoomBar
.
height
hoverEnabled
:
true
...
...
@@ -111,7 +113,7 @@ Rectangle {
var
updatedPos
=
Math
.
max
(
0
,
x
+
mouseX
)
updatedPos
=
Math
.
min
(
updatedPos
,
zoomEnd
.
x
-
width
-
1
)
var
firstFrame
=
Math
.
round
(
updatedPos
/
(
zoomHandleContainer
.
width
)
*
flickable
.
contentWidth
/
timeline
.
scaleFactor
)
var
lastFrame
=
Math
.
round
((
zoomBar
.
x
+
zoomBar
.
width
)
/
(
zoomHandleContainer
.
width
)
*
flickable
.
contentWidth
/
timeline
.
scaleFactor
)
var
lastFrame
=
Math
.
round
((
zoomBar
.
x
+
zoomBar
.
width
+
0.5
)
/
(
zoomHandleContainer
.
width
)
*
flickable
.
contentWidth
/
timeline
.
scaleFactor
)
root
.
zoomOnBar
=
firstFrame
timeline
.
scaleFactor
=
flickable
.
width
/
(
lastFrame
-
firstFrame
)
startHandleRect
.
x
=
updatedPos
-
x
...
...
@@ -133,9 +135,11 @@ Rectangle {
MouseArea
{
id
:
zoomEnd
property
bool
isActive
:
zoomEnd
.
containsMouse
||
zoomEnd
.
pressed
anchors.left
:
pressed
?
undefined
:
zoomBar
.
right
anchors.leftMargin
:
-
width
anchors.bottom
:
zoomBar
.
bottom
anchors
{
left
:
pressed
?
undefined
:
zoomBar
.
right
leftMargin
:
-
width
bottom
:
zoomBar
.
bottom
}
width
:
zoomBar
.
height
height
:
zoomBar
.
height
hoverEnabled
:
true
...
...
src/timeline2/view/qml/timeline.qml
View file @
d41fb202
...
...
@@ -32,10 +32,6 @@ Rectangle {
signal
processingDrag
(
bool
dragging
)
signal
showSubtitleClipMenu
()
// Zoombar properties
property
double
zoomStart
:
scrollView
.
visibleArea
.
xPosition
property
double
zoomBarWidth
:
scrollView
.
visibleArea
.
widthRatio
FontMetrics
{
id
:
fontMetrics
font
:
miniFont
...
...
@@ -1840,7 +1836,7 @@ Rectangle {
}
ZoomBar
{
id
:
horZoomBar
visible
:
root
.
zoomBarWidth
<
1
visible
:
scrollView
.
visibleArea
.
widthRatio
<
1
anchors
{
left
:
parent
.
left
right
:
parent
.
right
...
...
Write
Preview
Markdown
is supported
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