Mercurial > hg > svgui
comparison 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 |
comparison
equal
deleted
inserted
replaced
962:b12cd1c2dad5 | 965:73b0dc7d6ec1 |
---|---|
33 setObjectName(tr("Overview")); | 33 setObjectName(tr("Overview")); |
34 m_followPan = false; | 34 m_followPan = false; |
35 m_followZoom = false; | 35 m_followZoom = false; |
36 setPlaybackFollow(PlaybackIgnore); | 36 setPlaybackFollow(PlaybackIgnore); |
37 m_modelTestTime.start(); | 37 m_modelTestTime.start(); |
38 | |
39 bool light = hasLightBackground(); | |
40 if (light) m_boxColour = Qt::darkGray; | |
41 else m_boxColour = Qt::lightGray; | |
38 } | 42 } |
39 | 43 |
40 void | 44 void |
41 Overview::modelChangedWithin(sv_frame_t startFrame, sv_frame_t endFrame) | 45 Overview::modelChangedWithin(sv_frame_t startFrame, sv_frame_t endFrame) |
42 { | 46 { |
157 c.setAlpha(100); | 161 c.setAlpha(100); |
158 return c; | 162 return c; |
159 } | 163 } |
160 | 164 |
161 void | 165 void |
166 Overview::setBoxColour(QColor c) | |
167 { | |
168 m_boxColour = c; | |
169 } | |
170 | |
171 void | |
162 Overview::paintEvent(QPaintEvent *e) | 172 Overview::paintEvent(QPaintEvent *e) |
163 { | 173 { |
164 // Recalculate zoom in case the size of the widget has changed. | 174 // Recalculate zoom in case the size of the widget has changed. |
165 | 175 |
166 #ifdef DEBUG_OVERVIEW | 176 #ifdef DEBUG_OVERVIEW |
261 paint.setBrush(getFillWithin()); | 271 paint.setBrush(getFillWithin()); |
262 paint.drawRoundedRect(primary, 4, 4); | 272 paint.drawRoundedRect(primary, 4, 4); |
263 | 273 |
264 foreach (QRect vr, rects) { | 274 foreach (QRect vr, rects) { |
265 paint.setBrush(Qt::NoBrush); | 275 paint.setBrush(Qt::NoBrush); |
266 paint.setPen(QPen(Qt::gray, 2)); | 276 paint.setPen(QPen(m_boxColour, 2)); |
267 paint.drawRoundedRect(vr, 4, 4); | 277 paint.drawRoundedRect(vr, 4, 4); |
268 } | 278 } |
269 | 279 |
270 paint.end(); | 280 paint.end(); |
271 } | 281 } |