footageviewer: auto switch waveform mode when clicking video/audio buttons

This commit is contained in:
itsmattkc
2023-03-20 16:51:39 -07:00
parent 0a54585ece
commit 537908c605
7 changed files with 55 additions and 13 deletions
+22 -3
View File
@@ -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;
}
}