setToolTip(i18n("Zone duration: %1", m_timecode.getTimecodeFromFrames(m_zoneEnd - m_zoneStart)));
} else {
setCursor(Qt::ArrowCursor);
- setToolTip(QString());
+ setToolTip(i18n("Position: %1", m_timecode.getTimecodeFromFrames(pos)));
}
}
}
kapp->setPalette(plt);
const QObjectList children = statusBar()->children();
- foreach (QObject *child, children) {
- if (child->isWidgetType())
- ((QWidget*)child)->setPalette(plt);
- const QObjectList subchildren = child->children();
- foreach (QObject *subchild, subchildren) {
- if (subchild->isWidgetType())
- ((QWidget*)subchild)->setPalette(plt);
- }
+ foreach(QObject *child, children) {
+ if (child->isWidgetType())
+ ((QWidget*)child)->setPalette(plt);
+ const QObjectList subchildren = child->children();
+ foreach(QObject *subchild, subchildren) {
+ if (subchild->isWidgetType())
+ ((QWidget*)subchild)->setPalette(plt);
+ }
}
}
m_name(name),
m_monitorManager(manager),
m_currentClip(NULL),
- m_ruler(new SmallRuler()),
+ m_ruler(new SmallRuler(m_monitorManager)),
m_overlay(NULL),
m_isActive(false),
m_scale(1),
#include <QMouseEvent>
#include <QStylePainter>
-SmallRuler::SmallRuler(QWidget *parent) :
+SmallRuler::SmallRuler(MonitorManager *manager, QWidget *parent) :
QWidget(parent),
m_scale(1),
- m_maxval(25)
+ m_maxval(25),
+ m_manager(manager)
{
m_zoneStart = 10;
m_zoneEnd = 60;
m_zoneColor = QColor(133, 255, 143);
+ setMouseTracking(true);
}
void SmallRuler::adjustScale(int maximum)
{
const int pos = event->x() / m_scale;
if (event->buttons() & Qt::LeftButton) emit seekRenderer((int) pos);
+ else {
+ if (qAbs((pos - m_zoneStart) * m_scale) < 4) {
+ setToolTip(i18n("Zone start: %1", m_manager->timecode().getTimecodeFromFrames(m_zoneStart)));
+ } else if (qAbs((pos - m_zoneEnd) * m_scale) < 4) {
+ setToolTip(i18n("Zone end: %1", m_manager->timecode().getTimecodeFromFrames(m_zoneEnd)));
+ } else if (pos > m_zoneStart && pos < m_zoneEnd) {
+ setToolTip(i18n("Zone duration: %1", m_manager->timecode().getTimecodeFromFrames(m_zoneEnd - m_zoneStart)));
+ } else setToolTip(i18n("Position: %1", m_manager->timecode().getTimecodeFromFrames(pos)));
+ }
}
void SmallRuler::slotNewValue(int value)
#include <QWidget>
+#include "monitormanager.h"
+
class SmallRuler : public QWidget
{
Q_OBJECT
public:
- SmallRuler(QWidget *parent = 0);
+ SmallRuler(MonitorManager *manager, QWidget *parent = 0);
virtual void mousePressEvent(QMouseEvent * event);
virtual void mouseMoveEvent(QMouseEvent * event);
void adjustScale(int maximum);
QColor m_zoneColor;
QList <int> m_markers;
QPixmap m_pixmap;
+ MonitorManager *m_manager;
void updatePixmap();
public slots: