Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
39838f46
Commit
39838f46
authored
May 08, 2009
by
Ludovic Fauvet
Browse files
Timeline: ensure the cursor is always visible when dragging
parent
f8c66867
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/gui/TracksView.cpp
View file @
39838f46
...
...
@@ -52,6 +52,9 @@ TracksView::TracksView( QGraphicsScene* scene, QWidget* parent )
m_cursorLine
=
new
GraphicsCursorItem
(
maxHeight
,
QPen
(
QColor
(
220
,
30
,
30
)
)
);
m_scene
->
addItem
(
m_cursorLine
);
connect
(
m_cursorLine
,
SIGNAL
(
cursorPositionChanged
(
int
)
),
this
,
SLOT
(
ensureCursorVisible
()
)
);
}
void
TracksView
::
dragEnterEvent
(
QDragEnterEvent
*
event
)
...
...
@@ -217,3 +220,9 @@ void TracksView::setScale( double scaleFactor )
}
centerOn
(
m_cursorLine
);
}
void
TracksView
::
ensureCursorVisible
()
{
if
(
horizontalScrollBar
()
->
isVisible
()
)
m_cursorLine
->
ensureVisible
(
QRectF
(),
150
,
50
);
}
src/gui/TracksView.h
View file @
39838f46
...
...
@@ -60,6 +60,9 @@ protected:
virtual
void
dropEvent
(
QDropEvent
*
event
);
virtual
void
dragMoveEvent
(
QDragMoveEvent
*
event
);
private
slots
:
void
ensureCursorVisible
();
private:
QGraphicsScene
*
m_scene
;
int
m_tracksHeight
;
...
...
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