+ if (value == m_cursorFramePosition) return false;
+ if (value == m_lastSeekPosition) m_lastSeekPosition = SEEK_INACTIVE;
+ m_cursorFramePosition = value;
+ /*int oldPos = m_cursorPosition;
+ m_cursorPosition = value * m_scale;
+ const int offset = 6;
+ const int x = qMin(oldPos, m_cursorPosition);
+ const int w = qAbs(oldPos - m_cursorPosition);
+ update(x - offset, 0, w + 2 * offset, height());*/
+ update();
+ return true;
+}
+
+
+//virtual
+void SmallRuler::resizeEvent(QResizeEvent *)
+{
+ adjustScale(m_maxval);
+}
+
+void SmallRuler::updatePixmap()
+{
+ m_pixmap = QPixmap(width(), height());
+ m_pixmap.fill(palette().window().color());
+ m_lastSeekPosition = SEEK_INACTIVE;
+ QPainter p(&m_pixmap);
+ double f, fend;
+
+ const int zoneStart = (int)(m_zoneStart * m_scale);
+ const int zoneEnd = (int)(m_zoneEnd * m_scale);
+ p.fillRect(zoneStart, 0, zoneEnd - zoneStart, height(), QBrush(m_zoneColor));
+
+ // draw ruler
+ p.setPen(palette().midlight().color());
+ //p.drawLine(0, 0, width(), 0);
+ p.drawLine(0, height() - 1, width(), height() - 1);
+ p.setPen(palette().dark().color());
+ // draw the little marks
+ fend = m_scale * m_small;
+ if (fend > 2) for (f = 0; f < width(); f += fend) {
+ p.drawLine((int)f, 0, (int)f, 3);
+ }
+
+ // draw medium marks
+ fend = m_scale * m_medium;
+ if (fend > 2) for (f = 0; f < width(); f += fend) {
+ p.drawLine((int)f, 0, (int)f, 6);
+ }
+ // draw markers
+ if (!m_markers.isEmpty()) {
+ for (int i = 0; i < m_markers.count(); ++i) {
+ int pos = m_markers.at(i).time().frames(m_monitor->fps()) * m_scale;
+ p.setPen(CommentedTime::markerColor(m_markers.at(i).markerType()));
+ p.drawLine(pos, 0, pos, 9);
+ }
+ }
+ p.end();
+ update();