diff --git a/src/app/GUI/BoxesList/boxscroller.cpp b/src/app/GUI/BoxesList/boxscroller.cpp index d7b47f0ee..309c926d4 100755 --- a/src/app/GUI/BoxesList/boxscroller.cpp +++ b/src/app/GUI/BoxesList/boxscroller.cpp @@ -71,7 +71,7 @@ void BoxScroller::paintEvent(QPaintEvent *) { TimelineHighlightWidget *BoxScroller::requestHighlighter() { if(!mHighlighter) { - mHighlighter = new TimelineHighlightWidget(false, this); + mHighlighter = new TimelineHighlightWidget(false, this, true); mHighlighter->resize(size()); } return mHighlighter; diff --git a/src/app/GUI/animationwidgetscrollbar.cpp b/src/app/GUI/animationwidgetscrollbar.cpp index 3c14bdd25..10d637bcc 100755 --- a/src/app/GUI/animationwidgetscrollbar.cpp +++ b/src/app/GUI/animationwidgetscrollbar.cpp @@ -105,7 +105,7 @@ void FrameScrollBar::paintEvent(QPaintEvent *) { // draw minor ticks if (!mRange) { - p.setPen(mHandleColor); + p.setPen(QPen(Qt::white, 2)); while (xxL < maxX) { p.drawLine(QPointF(xxL, threeFourthsHeight + 2), QPointF(xxL, height())); xxL += inc/5; @@ -120,9 +120,9 @@ void FrameScrollBar::paintEvent(QPaintEvent *) { const qreal handleLeft = mBottom ? (hLeftFrames*pixPerFrame + x0) : ((hLeftFrames*pixPerFrame + x0)+(handleWidth/2)-(handleFixedWidth/2)); handleRect.setLeft(handleLeft); - handleRect.setTop(mBottom ? 2 : 5); + handleRect.setTop(mBottom ? 2 : 0); handleRect.setWidth(mBottom ? handleWidth : handleFixedWidth); - handleRect.setBottom(mBottom ? 6 : height()); + handleRect.setBottom(mBottom ? 6 : height()/2); if (mRange) { p.fillRect(handleRect, col); } else { // triangle QPainterPath path; @@ -133,7 +133,7 @@ void FrameScrollBar::paintEvent(QPaintEvent *) { p.fillPath(path, QColor(180, 0, 0)); } - p.setPen(Qt::white); + p.setPen(QPen(Qt::white, 2)); // draw main ticks if (!mRange) { diff --git a/src/app/GUI/keysview.cpp b/src/app/GUI/keysview.cpp index c26de56af..3087b6f39 100755 --- a/src/app/GUI/keysview.cpp +++ b/src/app/GUI/keysview.cpp @@ -60,7 +60,7 @@ KeysView::KeysView(BoxScrollWidget *boxesListVisible, TimelineHighlightWidget *KeysView::requestHighlighter() { if(!mHighlighter) { - mHighlighter = new TimelineHighlightWidget(true, this); + mHighlighter = new TimelineHighlightWidget(true, this, false); mHighlighter->resize(size()); } return mHighlighter; @@ -499,16 +499,6 @@ void KeysView::paintEvent(QPaintEvent *) { p.drawLine(QPointF(xTT, 0), QPointF(xTT, height())); } - if(mCurrentScene) { - if(mCurrentScene->getCurrentFrame() <= maxFrame && - mCurrentScene->getCurrentFrame() >= minFrame) { - xT = (mCurrentScene->getCurrentFrame() - mMinViewedFrame)*mPixelsPerFrame + - mPixelsPerFrame*0.5; - p.setPen(QPen(QColor(180, 0, 0), 2)); - p.drawLine(QPointF(xT, 0), QPointF(xT, height())); - } - } - p.setPen(QPen(Qt::black, 1)); if(mGraphViewed) { @@ -536,6 +526,15 @@ void KeysView::paintEvent(QPaintEvent *) { } } + if (mCurrentScene) { + if (mCurrentScene->getCurrentFrame() <= maxFrame && + mCurrentScene->getCurrentFrame() >= minFrame) { + xT = (mCurrentScene->getCurrentFrame() - mMinViewedFrame)*mPixelsPerFrame + mPixelsPerFrame*0.5; + p.setPen(QPen(QColor(180, 0, 0), 2)); + p.drawLine(QPointF(xT, 0), QPointF(xT, height())); + } + } + p.resetTransform(); if(mMovingKeys && mValueInput.inputEnabled()) mValueInput.draw(&p, height() - eSizesUI::widget); diff --git a/src/app/GUI/timelinehighlightwidget.cpp b/src/app/GUI/timelinehighlightwidget.cpp index 492ea166d..5e4c576d7 100755 --- a/src/app/GUI/timelinehighlightwidget.cpp +++ b/src/app/GUI/timelinehighlightwidget.cpp @@ -31,10 +31,13 @@ #include "GUI/global.h" #include "Private/esettings.h" -TimelineHighlightWidget::TimelineHighlightWidget( - const bool track, QWidget * const parent) : - QWidget(parent), - mSettings(*eSettings::sInstance) { +TimelineHighlightWidget::TimelineHighlightWidget(const bool track, + QWidget * const parent, + const bool alt) + : QWidget(parent) + , mAlt(alt) + , mSettings(*eSettings::sInstance) +{ setAttribute(Qt::WA_TranslucentBackground); setMouseTracking(track); } @@ -53,14 +56,14 @@ void TimelineHighlightWidget::leaveEvent(QEvent *) { void TimelineHighlightWidget::paintEvent(QPaintEvent *) { QPainter p(this); - if(mSettings.fTimelineAlternateRow) { + if (mSettings.fTimelineAlternateRow && mAlt) { const int height = this->height(); const QColor color = mSettings.fTimelineAlternateRowColor; - for(int i = 0; i < height; i += 2*eSizesUI::widget) { + for (int i = 0; i < height; i += 2*eSizesUI::widget) { p.fillRect(0, i, width(), eSizesUI::widget, color); } } - if(mSettings.fTimelineHighlightRow && mHoverRow >= 0) { + if (mSettings.fTimelineHighlightRow && mHoverRow >= 0) { p.fillRect(0, mHoverRow*eSizesUI::widget, width(), eSizesUI::widget, mSettings.fTimelineHighlightRowColor); diff --git a/src/app/GUI/timelinehighlightwidget.h b/src/app/GUI/timelinehighlightwidget.h index 67a433c9c..fed632d62 100755 --- a/src/app/GUI/timelinehighlightwidget.h +++ b/src/app/GUI/timelinehighlightwidget.h @@ -32,7 +32,9 @@ class eSettings; class TimelineHighlightWidget : public QWidget { public: - TimelineHighlightWidget(const bool track, QWidget* const parent); + TimelineHighlightWidget(const bool track, + QWidget* const parent, + const bool alt); void setOther(TimelineHighlightWidget* const other); protected: @@ -42,6 +44,7 @@ class TimelineHighlightWidget : public QWidget { private: void setHoverRow(const int row); + bool mAlt; int mHoverRow = -1; const eSettings& mSettings; TimelineHighlightWidget* mOther = nullptr;