playhead item covers entire scene
This commit is contained in:
@@ -77,5 +77,5 @@ NodeViewItemWidget {
|
||||
/* Timeline playhead styling */
|
||||
TimelinePlayhead {
|
||||
qproperty-playheadColor: #ff0000;
|
||||
qproperty-playheadHighlightColor: rgba(255, 255, 255, 0.33);
|
||||
qproperty-playheadHighlightColor: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <QDebug>
|
||||
#include <QMimeData>
|
||||
#include <QMouseEvent>
|
||||
#include <QScrollBar>
|
||||
#include <QtMath>
|
||||
#include <QPen>
|
||||
|
||||
@@ -168,6 +169,17 @@ void TimelineView::dropEvent(QDropEvent *event)
|
||||
import_tool_.DragDrop(event);
|
||||
}
|
||||
|
||||
void TimelineView::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QGraphicsView::resizeEvent(event);
|
||||
|
||||
if (scene_.height() < height()) {
|
||||
QRectF rect = scene_.sceneRect();
|
||||
rect.setHeight(height() - horizontalScrollBar()->height() - 2);
|
||||
scene_.setSceneRect(rect);
|
||||
}
|
||||
}
|
||||
|
||||
void TimelineView::AddGhost(TimelineViewGhostItem *ghost)
|
||||
{
|
||||
ghost->SetScale(scale_);
|
||||
|
||||
@@ -75,6 +75,8 @@ protected:
|
||||
virtual void dragLeaveEvent(QDragLeaveEvent *event) override;
|
||||
virtual void dropEvent(QDropEvent *event) override;
|
||||
|
||||
virtual void resizeEvent(QResizeEvent *event) override;
|
||||
|
||||
private:
|
||||
|
||||
class Tool
|
||||
|
||||
@@ -51,7 +51,7 @@ void TimelineViewPlayheadItem::UpdateRect()
|
||||
double x = TimeToScreenCoord(rational(playhead_ * timebase_.numerator(), timebase_.denominator()));
|
||||
double width = TimeToScreenCoord(timebase_);
|
||||
|
||||
setRect(0, 0, width, scene()->height());
|
||||
setRect(0, 0, width, scene()->height()-1);
|
||||
setPos(x, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user