Mercurial > hg > svgui
changeset 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 | b12cd1c2dad5 |
children | e297b7d752f2 |
files | view/Overview.cpp view/Overview.h |
diffstat | 2 files changed, 14 insertions(+), 1 deletions(-) [+] |
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); }
--- a/view/Overview.h Thu May 14 14:57:42 2015 +0100 +++ b/view/Overview.h Thu May 21 13:55:06 2015 +0100 @@ -49,6 +49,8 @@ virtual void viewZoomLevelChanged(View *, int, bool); virtual void viewManagerPlaybackFrameChanged(sv_frame_t); + virtual void setBoxColour(QColor); + protected: virtual void paintEvent(QPaintEvent *e); virtual void mousePressEvent(QMouseEvent *e); @@ -67,6 +69,7 @@ bool m_clickedInRange; sv_frame_t m_dragCentreFrame; QTime m_modelTestTime; + QColor m_boxColour; typedef std::set<View *> ViewSet; ViewSet m_views;