From 76aad9c468dec22755b9bf2fc146171415d7193e Mon Sep 17 00:00:00 2001 From: alexmitchell Date: Wed, 20 Feb 2019 15:49:05 +1030 Subject: [PATCH 1/2] Added single frame highlight to playhead inside timelinewidget, only shows if frame is larger than 5px --- ui/timelinewidget.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/timelinewidget.cpp b/ui/timelinewidget.cpp index 671626ad0..a9bbc70e5 100644 --- a/ui/timelinewidget.cpp +++ b/ui/timelinewidget.cpp @@ -3302,7 +3302,14 @@ void TimelineWidget::paintEvent(QPaintEvent*) { // Draw playhead p.setPen(Qt::red); int playhead_x = panel_timeline->getTimelineScreenPointFromFrame(olive::ActiveSequence->playhead); - p.drawLine(playhead_x, rect().top(), playhead_x, rect().bottom()); + p.drawLine(playhead_x, rect().top(), playhead_x, rect().bottom()); + + // Draw single frame highlight + int playhead_frame_width = panel_timeline->getTimelineScreenPointFromFrame(olive::ActiveSequence->playhead+1) - playhead_x; + if (playhead_frame_width > 5){ //hardcoded for now, maybe better way to do this? + QRectF singleFrameRect(playhead_x, rect().top(), playhead_frame_width, rect().bottom()); + p.fillRect(singleFrameRect, QColor(255,255,255,15)); + } // draw border p.setPen(QColor(0, 0, 0, 64)); From cf3abe0e86e46b5b6847b804fdf6d589cc72bfb6 Mon Sep 17 00:00:00 2001 From: alexmitchell Date: Wed, 20 Feb 2019 16:08:30 +1030 Subject: [PATCH 2/2] fix up white space, using spaces not tabs in this file --- ui/timelinewidget.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ui/timelinewidget.cpp b/ui/timelinewidget.cpp index a9bbc70e5..6e0f3d8ad 100644 --- a/ui/timelinewidget.cpp +++ b/ui/timelinewidget.cpp @@ -3302,14 +3302,14 @@ void TimelineWidget::paintEvent(QPaintEvent*) { // Draw playhead p.setPen(Qt::red); int playhead_x = panel_timeline->getTimelineScreenPointFromFrame(olive::ActiveSequence->playhead); - p.drawLine(playhead_x, rect().top(), playhead_x, rect().bottom()); + p.drawLine(playhead_x, rect().top(), playhead_x, rect().bottom()); - // Draw single frame highlight - int playhead_frame_width = panel_timeline->getTimelineScreenPointFromFrame(olive::ActiveSequence->playhead+1) - playhead_x; - if (playhead_frame_width > 5){ //hardcoded for now, maybe better way to do this? - QRectF singleFrameRect(playhead_x, rect().top(), playhead_frame_width, rect().bottom()); - p.fillRect(singleFrameRect, QColor(255,255,255,15)); - } + // Draw single frame highlight + int playhead_frame_width = panel_timeline->getTimelineScreenPointFromFrame(olive::ActiveSequence->playhead+1) - playhead_x; + if (playhead_frame_width > 5){ //hardcoded for now, maybe better way to do this? + QRectF singleFrameRect(playhead_x, rect().top(), playhead_frame_width, rect().bottom()); + p.fillRect(singleFrameRect, QColor(255,255,255,15)); + } // draw border p.setPen(QColor(0, 0, 0, 64));