Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLMC
Commits
a4653c7e
Commit
a4653c7e
authored
Mar 23, 2010
by
Ludovic Fauvet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
timeline: do not re-center the viewport vertically when the cursor move.
parent
5a43f4e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
src/Gui/timeline/TracksView.cpp
src/Gui/timeline/TracksView.cpp
+13
-4
src/Gui/timeline/TracksView.h
src/Gui/timeline/TracksView.h
+5
-0
No files found.
src/Gui/timeline/TracksView.cpp
View file @
a4653c7e
...
...
@@ -1061,13 +1061,22 @@ TracksView::ensureCursorVisible()
{
if
(
horizontalScrollBar
()
->
isVisible
()
)
{
QRectF
r
(
m_cursorLine
->
boundingRect
().
width
()
/
2
,
m_cursorLine
->
boundingRect
().
height
()
/
2
,
1
,
1
)
;
m_cursorLine
->
ensureVisible
(
r
,
150
,
5
0
);
QRectF
visibleArea
=
visibleRect
();
ensureVisible
(
cursorPos
()
,
visibleArea
.
y
()
+
(
visibleArea
.
height
()
/
2
)
,
1
,
1
,
150
,
0
);
}
}
QRectF
TracksView
::
visibleRect
()
{
QPointF
topLeft
(
horizontalScrollBar
()
->
value
(),
verticalScrollBar
()
->
value
()
);
QPointF
bottomRight
(
topLeft
+
viewport
()
->
rect
().
bottomRight
()
);
QMatrix
reverted
=
matrix
().
inverted
();
return
reverted
.
mapRect
(
QRectF
(
topLeft
,
bottomRight
)
);
}
void
TracksView
::
updateDuration
()
{
...
...
src/Gui/timeline/TracksView.h
View file @
a4653c7e
...
...
@@ -232,6 +232,11 @@ private slots:
* \brief Ensure that the cursor is visible.
*/
void
ensureCursorVisible
();
/**
* \brief Return the visible area of the viewport.
*/
QRectF
visibleRect
();
/**
* \brief Update the global duration of the project.
* This method should be called when an item is inserted, moved or removed to ensure
...
...
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