@@ -28,8 +28,7 @@ void FullTimeline::paint (Graphics& g)
2828 /* Draw timeline background */
2929 int tickHeight = 4 ;
3030 int borderThickness = 1 ;
31-
32- g.setColour (Colours::black);
31+ g.setColour (findColour (ThemeColours::componentParentBackground));
3332
3433 int numTicks = 5 ;
3534
@@ -44,7 +43,7 @@ void FullTimeline::paint (Graphics& g)
4443 }
4544
4645 g.fillRect (0 , 0 , this ->getWidth (), this ->getHeight () - tickHeight);
47- g.setColour (Colours::white );
46+ g.setColour (findColour (ThemeColours::widgetBackground) );
4847 g.fillRect (borderThickness, borderThickness, this ->getWidth () - 2 * borderThickness, this ->getHeight () - 2 * borderThickness - tickHeight);
4948
5049 /* Draw a coloured vertical bar for each event */
@@ -72,30 +71,40 @@ void FullTimeline::paint (Graphics& g)
7271 if (eventMap.find (timelinePos) != eventMap.end ())
7372 continue ;
7473 eventMap[timelinePos] = true ;
75- g.setColour (eventChannelColours[info.channels [i]]);
74+ Colour c = eventChannelColours[info.channels [i] + 1 ];
75+ g.setColour (c);
76+
7677 g.setOpacity (1 .0f );
7778 g.fillRoundedRectangle (timelinePos, 0 , 1 , this ->getHeight () - tickHeight, 0.2 );
7879 }
7980 }
8081 }
8182
8283 /* Draw the MAX_ZOOM_DURATION_IN_SECONDS interval */
83- g.setColour (Colour ( 0 , 0 , 0 ));
84+ g.setColour (findColour (ThemeColours::componentParentBackground ));
8485 g.setOpacity (0 .8f );
8586
8687 if (intervalStartPosition < 0 )
8788 return ;
89+
8890 setIntervalPosition (intervalStartPosition);
8991
92+ // Draw the scrubber interval bounds
9093 g.fillRoundedRectangle (intervalStartPosition, 0 , 2 , this ->getHeight (), 2 );
9194 g.fillRoundedRectangle (intervalStartPosition + intervalWidth, 0 , 2 , this ->getHeight (), 2 );
9295
96+ // Draw the scrubber interval as a highlight
97+ g.setColour (findColour (ThemeColours::menuHighlightBackground));
98+ g.setOpacity (0.3 );
99+ g.fillRect (intervalStartPosition + 1 , 0 , intervalWidth - 2 , this ->getHeight ()-2 );
100+
93101 /* Draw the current playback position */
102+ g.setColour (findColour (ThemeColours::defaultText));
94103 float timelinePos = (float ) (fileReader->getCurrentSample () - startSample) / totalSamples * getWidth ();
95-
96104 g.setOpacity (1 .0f );
97105 g.fillRoundedRectangle (timelinePos, 0 , 1 , this ->getHeight (), 0.2 );
98106
107+ // Update all time labels
99108 fileReader->getScrubberInterface ()->updateTimeLabels ();
100109}
101110
@@ -162,7 +171,7 @@ void ZoomTimeline::paint (Graphics& g)
162171 int tickHeight = 4 ;
163172 int borderThickness = 1 ;
164173
165- g.setColour (Colours::black );
174+ g.setColour (findColour (ThemeColours::componentParentBackground) );
166175
167176 int numTicks = 7 ;
168177
@@ -177,7 +186,7 @@ void ZoomTimeline::paint (Graphics& g)
177186 }
178187
179188 g.fillRect (0 , tickHeight, this ->getWidth (), this ->getHeight () - tickHeight);
180- g.setColour (Colours::white );
189+ g.setColour (findColour (ThemeColours::widgetBackground) );
181190 g.fillRect (borderThickness, tickHeight + borderThickness, this ->getWidth () - 2 * borderThickness, this ->getHeight () - 2 * borderThickness - tickHeight);
182191
183192 float sampleRate = fileReader->getCurrentSampleRate ();
@@ -201,27 +210,29 @@ void ZoomTimeline::paint (Graphics& g)
201210 if (state && sampleNumber >= startSampleNumber && sampleNumber <= stopSampleNumber)
202211 {
203212 float timelinePos = (sampleNumber - startSampleNumber) / float (intervalSamples) * getWidth ();
204- g.setColour (eventChannelColours[info.channels [i]]);
213+ Colour c = eventChannelColours[info.channels [i] + 1 ];
214+ g.setColour (c);
205215 g.setOpacity (1 .0f );
206216 g.fillRect (int (timelinePos), tickHeight, 1 , this ->getHeight () - tickHeight);
207217 }
208218 }
209219 }
210220
211- /* Draw the scrubber interval */
212- g.setColour (Colour (0 , 0 , 0 ));
213- g.fillRoundedRectangle (sliderPosition, 0 , sliderWidth, this ->getHeight (), 2 );
214- g.setColour (Colour (110 , 110 , 110 ));
215- g.setOpacity (0 .8f );
216- g.fillRoundedRectangle (sliderPosition + 1 , 1 , sliderWidth - 2 , this ->getHeight () - 2 , 2 );
217-
218221 /* Draw the current playback position */
222+ g.setColour (findColour (ThemeColours::defaultText));
219223 float timelinePos = (float ) (fileReader->getCurrentSample () - startSampleNumber) / (stopSampleNumber - startSampleNumber) * getWidth ();
220- if (fileReader-> playbackIsActive () || (! fileReader-> playbackIsActive () && timelinePos < sliderPosition + sliderWidth) )
224+ if (0 < timelinePos < sliderPosition + sliderWidth)
221225 {
222226 g.setOpacity (1 .0f );
223227 g.fillRoundedRectangle (timelinePos, 0 , 1 , this ->getHeight (), 0.2 );
224228 }
229+
230+ /* Draw the scrubber interval */
231+ g.setColour (findColour (ThemeColours::componentParentBackground));
232+ g.fillRoundedRectangle (sliderPosition, 0 , sliderWidth, this ->getHeight (), 2 );
233+ g.setColour (findColour (ThemeColours::componentBackground));
234+ g.setOpacity (0 .8f );
235+ g.fillRoundedRectangle (sliderPosition + 1 , 1 , sliderWidth - 2 , this ->getHeight () - 2 , 2 );
225236}
226237
227238void ZoomTimeline::mouseDown (const MouseEvent& event)
0 commit comments