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
Multimedia
Kdenlive
Commits
a03c4f9a
Commit
a03c4f9a
authored
Jul 11, 2019
by
Jean-Baptiste Mardelle
Browse files
Some improvments to timeline tooltips
parent
ff1fa2fd
Pipeline
#5165
passed with stage
in 16 minutes and 5 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/qml/Clip.qml
View file @
a03c4f9a
...
...
@@ -114,7 +114,7 @@ Rectangle {
}
contentItem
:
Label
{
color
:
activePalette
.
text
text
:
label
.
text
+
'
(
'
+
timeline
.
t
im
ecode
(
clipRoot
.
inPoint
)
+
'
-
'
+
timeline
.
t
im
ecode
(
clipRoot
.
outPoint
)
+
'
)
'
text
:
label
.
text
+
'
(
'
+
timeline
.
s
im
plifiedTC
(
clipRoot
.
inPoint
)
+
'
-
'
+
timeline
.
s
im
plifiedTC
(
clipRoot
.
outPoint
)
+
'
)
'
}
}
...
...
@@ -364,7 +364,7 @@ Rectangle {
}
contentItem
:
Label
{
color
:
activePalette
.
text
text
:
positionOffset
<
0
?
i18n
(
"
Offset: -%1
"
,
timeline
.
t
im
ecode
(
-
positionOffset
))
:
i18n
(
"
Offset: %1
"
,
timeline
.
t
im
ecode
(
positionOffset
))
text
:
positionOffset
<
0
?
i18n
(
"
Offset: -%1
"
,
timeline
.
s
im
plifiedTC
(
-
positionOffset
))
:
i18n
(
"
Offset: %1
"
,
timeline
.
s
im
plifiedTC
(
positionOffset
))
}
}
Text
{
...
...
@@ -673,7 +673,7 @@ Rectangle {
if
(
duration
!=
clipRoot
.
fadeIn
)
{
timeline
.
adjustFade
(
clipRoot
.
clipId
,
'
fadein
'
,
duration
,
-
1
)
// Show fade duration as time in a "bubble" help.
var
s
=
timeline
.
t
im
ecode
(
Math
.
max
(
duration
,
0
))
var
s
=
timeline
.
s
im
plifiedTC
(
Math
.
max
(
duration
,
0
))
bubbleHelp
.
show
(
clipRoot
.
x
,
parentTrack
.
y
+
clipRoot
.
height
,
s
)
}
}
...
...
@@ -774,7 +774,7 @@ Rectangle {
if
(
clipRoot
.
fadeOut
!=
duration
)
{
timeline
.
adjustFade
(
clipRoot
.
clipId
,
'
fadeout
'
,
duration
,
-
1
)
// Show fade duration as time in a "bubble" help.
var
s
=
timeline
.
t
im
ecode
(
Math
.
max
(
duration
,
0
))
var
s
=
timeline
.
s
im
plifiedTC
(
Math
.
max
(
duration
,
0
))
bubbleHelp
.
show
(
clipRoot
.
x
+
clipRoot
.
width
,
parentTrack
.
y
+
clipRoot
.
height
,
s
)
}
}
...
...
@@ -812,6 +812,21 @@ Rectangle {
Drag.proposedAction
:
Qt
.
MoveAction
visible
:
trimInMouseArea
.
pressed
||
(
root
.
activeTool
===
0
&&
!
mouseArea
.
drag
.
active
&&
clipRoot
.
width
>
4
*
width
)
ToolTip
{
visible
:
trimInMouseArea
.
containsMouse
&&
!
trimInMouseArea
.
pressed
font.pixelSize
:
root
.
baseUnit
delay
:
1000
timeout
:
5000
background
:
Rectangle
{
color
:
activePalette
.
alternateBase
border.color
:
activePalette
.
light
}
contentItem
:
Label
{
color
:
activePalette
.
text
text
:
i18n
(
"
In:%1
\n
Position:%2
"
,
timeline
.
simplifiedTC
(
clipRoot
.
inPoint
),
timeline
.
simplifiedTC
(
clipRoot
.
modelStart
))
}
}
MouseArea
{
id
:
trimInMouseArea
anchors.fill
:
parent
...
...
@@ -879,6 +894,21 @@ Rectangle {
Drag.proposedAction
:
Qt
.
MoveAction
visible
:
trimOutMouseArea
.
pressed
||
(
root
.
activeTool
===
0
&&
!
mouseArea
.
drag
.
active
&&
clipRoot
.
width
>
4
*
width
)
ToolTip
{
visible
:
trimOutMouseArea
.
containsMouse
&&
!
trimOutMouseArea
.
pressed
font.pixelSize
:
root
.
baseUnit
delay
:
1000
timeout
:
5000
background
:
Rectangle
{
color
:
activePalette
.
alternateBase
border.color
:
activePalette
.
light
}
contentItem
:
Label
{
color
:
activePalette
.
text
text
:
i18n
(
"
Out:
"
)
+
timeline
.
simplifiedTC
(
clipRoot
.
outPoint
)
}
}
MouseArea
{
id
:
trimOutMouseArea
anchors.fill
:
parent
...
...
src/timeline2/view/qml/Track.qml
View file @
a03c4f9a
...
...
@@ -285,10 +285,11 @@ Column{
clip
.
originalX
=
clip
.
draggedX
// Show amount trimmed as a time in a "bubble" help.
var
delta
=
new_duration
-
clip
.
originalDuration
var
s
=
timeline
.
t
im
ecode
(
Math
.
abs
(
delta
))
s
=
'
%1%2
= %3
'
.
arg
((
delta
<
0
)?
'
+
'
:
(
delta
>
0
)?
'
-
'
:
''
)
var
s
=
timeline
.
s
im
plifiedTC
(
Math
.
abs
(
delta
))
s
=
'
%1%2
\n
%3:%4
'
.
arg
((
delta
<
=
0
)?
'
+
'
:
'
-
'
)
.
arg
(
s
)
.
arg
(
timeline
.
timecode
(
clipDuration
))
.
arg
(
i18n
(
"
In
"
))
.
arg
(
timeline
.
simplifiedTC
(
clip
.
inPoint
))
bubbleHelp
.
show
(
clip
.
x
-
20
,
trackRoot
.
y
+
trackRoot
.
height
,
s
)
}
}
...
...
@@ -327,10 +328,11 @@ Column{
clip
.
lastValidDuration
=
new_duration
// Show amount trimmed as a time in a "bubble" help.
var
delta
=
clip
.
originalDuration
-
new_duration
var
s
=
timeline
.
t
im
ecode
(
Math
.
abs
(
delta
))
s
=
'
%1%2
= %3
'
.
arg
((
delta
<
0
)?
'
+
'
:
(
delta
>
0
)?
'
-
'
:
''
)
var
s
=
timeline
.
s
im
plifiedTC
(
Math
.
abs
(
delta
))
s
=
'
%1%2
\n
%3:%4
'
.
arg
((
delta
<
=
0
)?
'
+
'
:
'
-
'
)
.
arg
(
s
)
.
arg
(
timeline
.
timecode
(
new_duration
))
.
arg
(
i18n
(
"
Duration
"
))
.
arg
(
timeline
.
simplifiedTC
(
new_duration
))
bubbleHelp
.
show
(
clip
.
x
+
clip
.
width
-
20
,
trackRoot
.
y
+
trackRoot
.
height
,
s
)
}
}
...
...
@@ -368,10 +370,10 @@ Column{
clip
.
originalX
=
clip
.
draggedX
// Show amount trimmed as a time in a "bubble" help.
var
delta
=
newDuration
-
clip
.
originalDuration
var
s
=
timeline
.
t
im
ecode
(
Math
.
abs
(
delta
))
s
=
'
%1%2 = %3
'
.
arg
((
delta
<
0
)?
'
+
'
:
(
delta
>
0
)?
'
-
'
:
''
)
var
s
=
timeline
.
s
im
plifiedTC
(
Math
.
abs
(
delta
))
s
=
'
%1%2 = %3
'
.
arg
((
delta
<
=
0
)?
'
+
'
:
'
-
'
)
.
arg
(
s
)
.
arg
(
timeline
.
t
im
ecode
(
clipDuration
))
.
arg
(
timeline
.
s
im
plifiedTC
(
clipDuration
))
bubbleHelp
.
show
(
clip
.
x
+
clip
.
width
,
trackRoot
.
y
+
trackRoot
.
height
,
s
)
}
}
...
...
@@ -386,10 +388,10 @@ Column{
clip
.
lastValidDuration
=
newDuration
// Show amount trimmed as a time in a "bubble" help.
var
delta
=
newDuration
-
clip
.
originalDuration
var
s
=
timeline
.
t
im
ecode
(
Math
.
abs
(
delta
))
s
=
'
%1%2 = %3
'
.
arg
((
delta
<
0
)?
'
+
'
:
(
delta
>
0
)?
'
-
'
:
''
)
var
s
=
timeline
.
s
im
plifiedTC
(
Math
.
abs
(
delta
))
s
=
'
%1%2 = %3
'
.
arg
((
delta
<
=
0
)?
'
+
'
:
'
-
'
)
.
arg
(
s
)
.
arg
(
timeline
.
t
im
ecode
(
clipDuration
))
.
arg
(
timeline
.
s
im
plifiedTC
(
clipDuration
))
bubbleHelp
.
show
(
clip
.
x
+
clip
.
width
,
trackRoot
.
y
+
trackRoot
.
height
,
s
)
}
}
...
...
src/timeline2/view/qml/timeline.qml
View file @
a03c4f9a
...
...
@@ -1227,12 +1227,9 @@ Rectangle {
}
var
delta
=
dragFrame
-
dragProxy
.
sourceFrame
if
(
delta
!=
0
)
{
var
s
=
timeline
.
timecode
(
Math
.
abs
(
delta
))
// remove leading zeroes
if
(
s
.
substring
(
0
,
3
)
===
'
00:
'
)
s
=
s
.
substring
(
3
)
s
=
((
delta
<
0
)?
'
-
'
:
(
delta
>
0
)?
'
+
'
:
''
)
+
s
bubbleHelp
.
show
(
parent
.
x
,
ruler
.
height
,
s
)
var
s
=
timeline
.
simplifiedTC
(
Math
.
abs
(
delta
))
s
=
((
delta
<
0
)?
'
-
'
:
'
+
'
)
+
s
+
i18n
(
"
\n
Position:%1
"
,
timeline
.
simplifiedTC
(
dragFrame
))
bubbleHelp
.
show
(
parent
.
x
+
mouseX
,
Math
.
max
(
ruler
.
height
,
Logic
.
getTrackYFromId
(
timeline
.
activeTrack
)),
s
)
}
else
bubbleHelp
.
hide
()
}
}
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
a03c4f9a
...
...
@@ -484,6 +484,15 @@ QString TimelineController::timecode(int frames)
return
KdenliveSettings
::
frametimecode
()
?
QString
::
number
(
frames
)
:
m_model
->
tractor
()
->
frames_to_time
(
frames
,
mlt_time_smpte_df
);
}
QString
TimelineController
::
simplifiedTC
(
int
frames
)
{
if
(
KdenliveSettings
::
frametimecode
())
{
return
QString
::
number
(
frames
);
}
QString
s
=
m_model
->
tractor
()
->
frames_to_time
(
frames
,
mlt_time_smpte_df
);
return
s
.
startsWith
(
QLatin1String
(
"00:"
))
?
s
.
remove
(
0
,
3
)
:
s
;
}
bool
TimelineController
::
showThumbnails
()
const
{
return
KdenliveSettings
::
videothumbnails
();
...
...
src/timeline2/view/timelinecontroller.h
View file @
a03c4f9a
...
...
@@ -164,6 +164,7 @@ public:
Q_INVOKABLE
bool
ripple
();
Q_INVOKABLE
bool
scrub
();
Q_INVOKABLE
QString
timecode
(
int
frames
);
Q_INVOKABLE
QString
simplifiedTC
(
int
frames
);
/* @brief Request inserting a new clip in timeline (dragged from bin or monitor)
@param tid is the destination track
@param position is the timeline position
...
...
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