Mercurial > hg > svgui
diff view/Pane.cpp @ 765:410816717c2c tony_integration
Merge from tonioni branch
author | Chris Cannam |
---|---|
date | Wed, 07 May 2014 15:12:13 +0100 |
parents | 9cfcb2924ee3 30bc7b2155dc |
children | 488add397d34 4c8ca536b54f |
line wrap: on
line diff
--- a/view/Pane.cpp Wed Apr 02 08:53:32 2014 +0100 +++ b/view/Pane.cpp Wed May 07 15:12:13 2014 +0100 @@ -465,6 +465,10 @@ m_scaleWidth = 0; + if (workModel) { + drawModelTimeExtents(r, paint, workModel); + } + if (m_manager && m_manager->shouldShowVerticalScale() && topLayer) { drawVerticalScale(r, topLayer, paint); } @@ -775,6 +779,39 @@ } void +Pane::drawModelTimeExtents(QRect r, QPainter &paint, const Model *model) +{ + int x0 = getXForFrame(model->getStartFrame()); + int x1 = getXForFrame(model->getEndFrame()); + + int lw = 10; + + paint.save(); + + QBrush brush; + + if (hasLightBackground()) { + brush = QBrush(QColor("#f8f8f8")); + paint.setPen(Qt::black); + } else { + brush = QBrush(QColor("#101010")); + paint.setPen(Qt::white); + } + + if (x0 > r.x()) { + paint.fillRect(0, 0, x0, height(), brush); + paint.drawLine(x0, 0, x0, height()); + } + + if (x1 < r.x() + r.width()) { + paint.fillRect(x1, 0, width() - x1, height(), brush); + paint.drawLine(x1, 0, x1, height()); + } + + paint.restore(); +} + +void Pane::drawAlignmentStatus(QRect r, QPainter &paint, const Model *model, bool down) {