# HG changeset patch # User Chris Cannam # Date 1396430787 -3600 # Node ID 30bc7b2155dc6aab7f8600968776e65320c7187f # Parent 785c6f175ccce42b275cbc8ea53e6b237595ef18 Grey out the areas outside the main work model. This may not be appropriate as-is for SV, but it might be nice in Tony diff -r 785c6f175ccc -r 30bc7b2155dc view/Pane.cpp --- a/view/Pane.cpp Wed Apr 02 09:01:56 2014 +0100 +++ b/view/Pane.cpp Wed Apr 02 10:26:27 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) { diff -r 785c6f175ccc -r 30bc7b2155dc view/Pane.h --- a/view/Pane.h Wed Apr 02 09:01:56 2014 +0100 +++ b/view/Pane.h Wed Apr 02 10:26:27 2014 +0100 @@ -107,6 +107,7 @@ void drawVerticalScale(QRect r, Layer *, QPainter &); void drawFeatureDescription(Layer *, QPainter &); void drawCentreLine(int, QPainter &, bool omitLine); + void drawModelTimeExtents(QRect, QPainter &, const Model *); void drawDurationAndRate(QRect, const Model *, int, QPainter &); void drawWorkTitle(QRect, QPainter &, const Model *); void drawLayerNames(QRect, QPainter &);