-
- p.fillRect(QRect(zoneStart - offset(), e->rect().y() + e->rect().height() / 2, zoneEnd - zoneStart, e->rect().height() / 2), QBrush(QColor(133, 255, 143)));
-
- const int value = m_view->cursorPos() * m_factor - offset();
- const int minval = minimum();
- const int maxval = maximum() + offset() - endOffset();
-
- double f, fend,
- offsetmin = (double)(minval - offset()),
- offsetmax = (double)(maxval - offset()),
- fontOffset = (((double)minval) > offsetmin) ? (double)minval : offsetmin;
- QRect bg = QRect((int)offsetmin, 0, (int)offsetmax, height());
-
- QPalette palette;
- //p.fillRect(bg, palette.light());
- // draw labels
- p.setPen(palette.dark().color());
- // draw littlemarklabel
-
- // draw mediummarklabel
-
- // draw bigmarklabel
-
- // draw endlabel
- /*if (d->showEndL) {
- if (d->dir == Qt::Horizontal) {
- p.translate( fontOffset, 0 );
- p.drawText( END_LABEL_X, END_LABEL_Y, d->endlabel );
- }*/
-
- // draw the tiny marks
- //if (showTinyMarks())
- /*{
- fend = pixelPerMark()*tinyMarkDistance();
- if (fend > 5) for ( f=offsetmin; f<offsetmax; f+=fend ) {
- p.drawLine((int)f, BASE_MARK_X1, (int)f, BASE_MARK_X2);
- }
- }*/
-
- for (f = offsetmin; f < offsetmax; f += m_textSpacing) {
- QString lab = m_timecode.getTimecodeFromFrames((int)((f - offsetmin) / m_factor + 0.5));
- p.drawText((int)f + 2, LABEL_SIZE, lab);
+ p.fillRect(zoneStart - m_offset, LABEL_SIZE + 2, zoneEnd - zoneStart, MAX_HEIGHT - LABEL_SIZE - 2, m_zoneColor);
+
+ int minval = (e->rect().left() + m_offset) / FRAME_SIZE - 1;
+ const int maxval = (e->rect().right() + m_offset) / FRAME_SIZE + 1;
+ if (minval < 0)
+ minval = 0;
+
+ double f, fend;
+ const int offsetmax = maxval * FRAME_SIZE;
+ int offsetmin;
+
+ p.setPen(palette().text().color());
+
+ // draw time labels
+ if (e->rect().y() < LABEL_SIZE) {
+ offsetmin = (e->rect().left() + m_offset) / m_textSpacing;
+ offsetmin = offsetmin * m_textSpacing;
+ for (f = offsetmin; f < offsetmax; f += m_textSpacing) {
+ QString lab;
+ if (KdenliveSettings::frametimecode())
+ lab = QString::number((int)(f / m_factor + 0.5));
+ else
+ lab = m_timecode.getTimecodeFromFrames((int)(f / m_factor + 0.5));
+ p.drawText(f - m_offset + 2, LABEL_SIZE, lab);
+ }