From 46f5433732654d8090cc75ee21f3a00f93910439 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Sun, 27 Oct 2019 08:45:58 -0300 Subject: [PATCH] New BARS_PER_GROUP constant --- src/core/Track.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/Track.cpp b/src/core/Track.cpp index dedfcbc27..5c61dc5ab 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -73,6 +73,10 @@ */ const int RESIZE_GRIP_WIDTH = 4; +/*! Alternate between a darker and a lighter background color every 4 bars + */ +const int BARS_PER_GROUP = 4; + /*! A pointer for that text bubble used when moving segments, etc. * @@ -1271,8 +1275,7 @@ void TrackContentWidget::updateBackground() // Assume even-pixels-per-bar. Makes sense, should be like this anyways int ppb = static_cast( tcv->pixelsPerBar() ); - // alternate between a darker and a lighter color every 4 bars - int w = ppb * 4; + int w = ppb * BARS_PER_GROUP; int h = height(); m_background = QPixmap( w * 2, height() ); QPainter pmp( &m_background );