implemented cursors in the timeline

Note: this does not use the cursor SVGs in app/ui/cursors since I was never
really satisfied with them. They're kept for posterity for the time being.
This commit is contained in:
itsmattkc
2020-01-03 17:58:07 +11:00
parent 7f796bd99f
commit ef91f81e0f
22 changed files with 129 additions and 30 deletions
+14 -2
View File
@@ -15,6 +15,7 @@
TimelineWidget::TimelineWidget(QWidget *parent) :
QWidget(parent),
rubberband_(QRubberBand::Rectangle, this),
active_tool_(nullptr),
timeline_node_(nullptr),
playhead_(0)
{
@@ -652,8 +653,17 @@ void TimelineWidget::ViewMousePressed(TimelineViewMouseEvent *event)
void TimelineWidget::ViewMouseMoved(TimelineViewMouseEvent *event)
{
if (timeline_node_ != nullptr && active_tool_ != nullptr) {
active_tool_->MouseMove(event);
if (timeline_node_) {
if (active_tool_) {
active_tool_->MouseMove(event);
} else {
// Mouse is not down, attempt a hover event
Tool* hover_tool = GetActiveTool();
if (hover_tool) {
hover_tool->HoverMove(event);
}
}
}
}
@@ -661,6 +671,7 @@ void TimelineWidget::ViewMouseReleased(TimelineViewMouseEvent *event)
{
if (timeline_node_ != nullptr && active_tool_ != nullptr) {
active_tool_->MouseRelease(event);
active_tool_ = nullptr;
}
}
@@ -668,6 +679,7 @@ void TimelineWidget::ViewMouseDoubleClicked(TimelineViewMouseEvent *event)
{
if (timeline_node_ != nullptr && active_tool_ != nullptr) {
active_tool_->MouseDoubleClick(event);
active_tool_ = nullptr;
}
}