Mercurial > hg > svgui
diff view/Overview.cpp @ 965:73b0dc7d6ec1
Box colour a darker grey by default (but also changeable now)
author | Chris Cannam |
---|---|
date | Thu, 21 May 2015 13:55:06 +0100 |
parents | 1c529a22a6a7 |
children | 57d192e26331 97d0c798c2ac |
line wrap: on
line diff
--- a/view/Overview.cpp Thu May 14 14:57:42 2015 +0100 +++ b/view/Overview.cpp Thu May 21 13:55:06 2015 +0100 @@ -35,6 +35,10 @@ m_followZoom = false; setPlaybackFollow(PlaybackIgnore); m_modelTestTime.start(); + + bool light = hasLightBackground(); + if (light) m_boxColour = Qt::darkGray; + else m_boxColour = Qt::lightGray; } void @@ -159,6 +163,12 @@ } void +Overview::setBoxColour(QColor c) +{ + m_boxColour = c; +} + +void Overview::paintEvent(QPaintEvent *e) { // Recalculate zoom in case the size of the widget has changed. @@ -263,7 +273,7 @@ foreach (QRect vr, rects) { paint.setBrush(Qt::NoBrush); - paint.setPen(QPen(Qt::gray, 2)); + paint.setPen(QPen(m_boxColour, 2)); paint.drawRoundedRect(vr, 4, 4); }