Add right click menu to clear I/O points when they exist in timelineheader
This commit is contained in:
+1
-2
@@ -31,6 +31,7 @@ public slots:
|
|||||||
void new_project();
|
void new_project();
|
||||||
void autorecover_interval();
|
void autorecover_interval();
|
||||||
void on_actionNest_triggered();
|
void on_actionNest_triggered();
|
||||||
|
void on_actionClear_In_Out_triggered();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent *);
|
void closeEvent(QCloseEvent *);
|
||||||
@@ -157,8 +158,6 @@ private slots:
|
|||||||
|
|
||||||
void on_actionSet_Out_Point_triggered();
|
void on_actionSet_Out_Point_triggered();
|
||||||
|
|
||||||
void on_actionClear_In_Out_triggered();
|
|
||||||
|
|
||||||
void on_actionDelete_In_Out_triggered();
|
void on_actionDelete_In_Out_triggered();
|
||||||
|
|
||||||
void on_actionRipple_Delete_In_Out_triggered();
|
void on_actionRipple_Delete_In_Out_triggered();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "timelineheader.h"
|
#include "timelineheader.h"
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
#include "panels/panels.h"
|
#include "panels/panels.h"
|
||||||
#include "panels/timeline.h"
|
#include "panels/timeline.h"
|
||||||
#include "project/sequence.h"
|
#include "project/sequence.h"
|
||||||
@@ -12,6 +13,8 @@
|
|||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QtMath>
|
#include <QtMath>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QAction>
|
||||||
|
|
||||||
#define CLICK_RANGE 5
|
#define CLICK_RANGE 5
|
||||||
#define PLAYHEAD_SIZE 6
|
#define PLAYHEAD_SIZE 6
|
||||||
@@ -45,6 +48,9 @@ TimelineHeader::TimelineHeader(QWidget *parent) :
|
|||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
setFocusPolicy(Qt::ClickFocus);
|
setFocusPolicy(Qt::ClickFocus);
|
||||||
show_text(true);
|
show_text(true);
|
||||||
|
|
||||||
|
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
|
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(show_context_menu(const QPoint &)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TimelineHeader::set_scroll(int s) {
|
void TimelineHeader::set_scroll(int s) {
|
||||||
@@ -394,3 +400,14 @@ void TimelineHeader::paintEvent(QPaintEvent*) {
|
|||||||
p.fillPath(path, Qt::red);
|
p.fillPath(path, Qt::red);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TimelineHeader::show_context_menu(const QPoint &pos)
|
||||||
|
{
|
||||||
|
QMenu contextMenu(tr("Context menu"), this);
|
||||||
|
|
||||||
|
QAction clear_in_out("Clear In/Out Points", this);
|
||||||
|
if (!viewer->seq->using_workarea) clear_in_out.setVisible(false);
|
||||||
|
connect(&clear_in_out, SIGNAL(triggered()), mainWindow, SLOT(on_actionClear_In_Out_triggered()));
|
||||||
|
contextMenu.addAction(&clear_in_out);
|
||||||
|
contextMenu.exec(mapToGlobal(pos));
|
||||||
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
void set_scroll(int);
|
void set_scroll(int);
|
||||||
void set_visible_in(long i);
|
void set_visible_in(long i);
|
||||||
|
void show_context_menu(const QPoint &pos);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent*);
|
void paintEvent(QPaintEvent*);
|
||||||
|
|||||||
Reference in New Issue
Block a user