updateFrameSize();
m_scale = 3;
m_zoneColor = KStatefulBrush(KColorScheme::View, KColorScheme::FocusColor, KSharedConfig::openConfig(KdenliveSettings::colortheme())).brush(this).color();
+ m_zoneColor.setAlpha(180);
m_zoneStart = 0;
m_zoneEnd = 100;
m_contextMenu = new QMenu(this);
void CustomRuler::updatePalette()
{
m_zoneColor = KStatefulBrush(KColorScheme::View, KColorScheme::FocusColor, KSharedConfig::openConfig(KdenliveSettings::colortheme())).brush(this).color();
+ m_zoneColor.setAlpha(180);
}
void CustomRuler::updateProjectFps(Timecode t)
// virtual
void CustomRuler::mouseMoveEvent(QMouseEvent * event)
{
+ int mappedXPos = (int)((event->x() + offset()) / m_factor);
+ emit mousePosition(mappedXPos);
if (event->buttons() == Qt::LeftButton) {
int pos;
if (m_moveCursor == RULER_START || m_moveCursor == RULER_END) {
- pos = m_view->getSnapPointForPos((int)((event->x() + offset()) / m_factor));
- } else pos = (int)((event->x() + offset()) / m_factor);
+ pos = m_view->getSnapPointForPos(mappedXPos);
+ } else pos = mappedXPos;
int zoneStart = m_zoneStart;
int zoneEnd = m_zoneEnd;
if (pos < 0) pos = 0;
int pos = (int)((event->x() + m_offset));
if (m_cursorColor == palette().text() && qAbs(pos - m_view->cursorPos() * m_factor) < 7) {
// Mouse is over cursor
- m_cursorColor = palette().highlight();
+ m_cursorColor = palette().link();
update(m_view->cursorPos() * m_factor - m_offset - 10, LABEL_SIZE + 2, 20, MAX_HEIGHT - LABEL_SIZE - 2);
}
- else if (m_cursorColor == palette().highlight() && qAbs(pos - m_view->cursorPos() * m_factor) >= 7) {
+ else if (m_cursorColor == palette().link() && qAbs(pos - m_view->cursorPos() * m_factor) >= 7) {
m_cursorColor = palette().text();
update(m_view->cursorPos() * m_factor - m_offset - 10, LABEL_SIZE + 2, 20, MAX_HEIGHT - LABEL_SIZE - 2);
}
void CustomRuler::leaveEvent(QEvent * event)
{
QWidget::leaveEvent(event);
- if (m_cursorColor == palette().highlight()) {
+ if (m_cursorColor == palette().link()) {
m_cursorColor = palette().text();
update();
}
void CustomRuler::wheelEvent(QWheelEvent * e)
{
int delta = 1;
+ m_view->activateMonitor();
if (e->modifiers() == Qt::ControlModifier) delta = m_timecode.fps();
if (e->delta() < 0) delta = 0 - delta;
m_view->moveCursorPos(delta);
p.drawPolygon(pa);
if (m_lastSeekPosition != SEEK_INACTIVE && m_lastSeekPosition != m_view->cursorPos()) {
- p.fillRect(m_lastSeekPosition * m_factor - m_offset - 1, BIG_MARK_X + 1, 3, MAX_HEIGHT - BIG_MARK_X - 1, palette().highlight());
+ p.fillRect(m_lastSeekPosition * m_factor - m_offset - 1, BIG_MARK_X + 1, 3, MAX_HEIGHT - BIG_MARK_X - 1, palette().linkVisited());
}
}