footageviewer: auto switch waveform mode when clicking video/audio buttons
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2022 Olive Team
|
||||
Copyright (C) 2023 Olive Studios LLC
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -20,18 +20,37 @@
|
||||
|
||||
#include "dragbutton.h"
|
||||
|
||||
#include <QMouseEvent>
|
||||
|
||||
namespace olive {
|
||||
|
||||
DragButton::DragButton(QWidget *parent) :
|
||||
QPushButton(parent)
|
||||
{
|
||||
setCursor(Qt::OpenHandCursor);
|
||||
dragging_ = false;
|
||||
}
|
||||
|
||||
void DragButton::mousePressEvent(QMouseEvent *event) {
|
||||
void DragButton::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
QPushButton::mousePressEvent(event);
|
||||
}
|
||||
|
||||
emit MousePressed();
|
||||
void DragButton::mouseMoveEvent(QMouseEvent *event)
|
||||
{
|
||||
QPushButton::mouseMoveEvent(event);
|
||||
|
||||
if (event->buttons() && !dragging_) {
|
||||
emit DragStarted();
|
||||
dragging_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
void DragButton::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
QPushButton::mouseReleaseEvent(event);
|
||||
|
||||
dragging_ = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user