completed focus filter and menu helpers

This commit is contained in:
itsmattkc
2019-02-14 20:30:44 -08:00
parent acf286e1d8
commit f34a2914ee
17 changed files with 358 additions and 309 deletions
+2 -3
View File
@@ -52,7 +52,6 @@ ProjectModel project_model;
QString autorecovery_filename;
QStringList recent_projects;
QString recent_proj_file;
Project::Project(QWidget *parent) :
QDockWidget(parent)
@@ -1226,7 +1225,7 @@ void Project::set_tree_view() {
void Project::save_recent_projects() {
// save to file
QFile f(recent_proj_file);
QFile f(Olive::Global->get_recent_project_list_file());
if (f.open(QFile::WriteOnly | QFile::Truncate | QFile::Text)) {
QTextStream out(&f);
for (int i=0;i<recent_projects.size();i++) {
@@ -1262,7 +1261,7 @@ void Project::go_up_dir() {
void Project::make_new_menu() {
QMenu new_menu(this);
Olive::MenuHelper.make_new_menu(&new_menu);
new_menu.exec(QCursor::pos());
new_menu.exec(QCursor::pos());
}
void Project::add_recent_project(QString url) {
+1 -3
View File
@@ -30,8 +30,6 @@ class SourcesCommon;
extern QString autorecovery_filename;
extern QStringList recent_projects;
extern QString recent_proj_file;
extern ProjectModel project_model;
Sequence* create_sequence_from_media(QVector<Media *> &media_list);
@@ -107,7 +105,7 @@ private slots:
void set_icon_view_size(int);
void set_up_dir_enabled();
void go_up_dir();
void make_new_menu();
void make_new_menu();
};
class MediaThrobber : public QObject {
+39 -3
View File
@@ -615,7 +615,7 @@ void Timeline::resizeEvent(QResizeEvent *) {
tool_button_widget->setFixedWidth((tool_button_children.at(0)->sizeHint().width())*cols + horizontal_spacing*(cols-1) + 1);
}
void Timeline::delete_in_out(bool ripple) {
void Timeline::delete_in_out_internal(bool ripple) {
if (Olive::ActiveSequence != nullptr && Olive::ActiveSequence->using_workarea) {
QVector<Selection> areas;
int video_tracks = 0, audio_tracks = 0;
@@ -1231,7 +1231,7 @@ void Timeline::paste(bool insert) {
}
}
void Timeline::ripple_to_in_point(bool in, bool ripple) {
void Timeline::edit_to_point_internal(bool in, bool ripple) {
if (Olive::ActiveSequence != nullptr) {
if (Olive::ActiveSequence->clips.size() > 0) {
// get track count
@@ -1439,7 +1439,19 @@ void Timeline::split_at_playhead() {
update_ui(true);
} else {
delete ca;
}
}
}
void Timeline::ripple_delete() {
if (Olive::ActiveSequence != nullptr) {
if (Olive::ActiveSequence->selections.size() > 0) {
panel_timeline->delete_selection(Olive::ActiveSequence->selections, true);
} else if (config.hover_focus && get_focused_panel() == panel_timeline) {
if (panel_timeline->can_ripple_empty_space(panel_timeline->cursor_frame, panel_timeline->cursor_track)) {
panel_timeline->ripple_delete_empty_space();
}
}
}
}
void Timeline::deselect_area(long in, long out, int track) {
@@ -1565,6 +1577,30 @@ void Timeline::set_marker() {
}
void Timeline::delete_inout() {
panel_timeline->delete_in_out_internal(false);
}
void Timeline::ripple_delete_inout() {
panel_timeline->delete_in_out_internal(true);
}
void Timeline::ripple_to_in_point() {
panel_timeline->edit_to_point_internal(true, true);
}
void Timeline::ripple_to_out_point() {
panel_timeline->edit_to_point_internal(false, true);
}
void Timeline::edit_to_in_point() {
panel_timeline->edit_to_point_internal(true, false);
}
void Timeline::edit_to_out_point() {
panel_timeline->edit_to_point_internal(false, false);
}
void Timeline::toggle_links() {
LinkCommand* command = new LinkCommand();
command->s = Olive::ActiveSequence;
+11 -2
View File
@@ -91,8 +91,8 @@ public:
QVector<int> get_tracks_of_linked_clips(int i);
bool has_clip_been_split(int c);
void ripple_to_in_point(bool in, bool ripple);
void delete_in_out(bool ripple);
void edit_to_point_internal(bool in, bool ripple);
void delete_in_out_internal(bool ripple);
void create_ghosts_from_media(Sequence *seq, long entry_point, QVector<Media *> &media_list);
void add_clips_from_ghosts(ComboAction *ca, Sequence *s);
@@ -210,9 +210,18 @@ public slots:
void deselect();
void toggle_links();
void split_at_playhead();
void ripple_delete();
void ripple_delete_empty_space();
void toggle_enable_on_selected_clips();
void delete_inout();
void ripple_delete_inout();
void ripple_to_in_point();
void ripple_to_out_point();
void edit_to_in_point();
void edit_to_out_point();
void increase_track_height();
void decrease_track_height();
-1
View File
@@ -13,7 +13,6 @@
#include "project/undo.h"
#include "ui/audiomonitor.h"
#include "playback/playback.h"
#include "ui/viewerwidget.h"
#include "ui/viewercontainer.h"
#include "ui/labelslider.h"
#include "ui/timelineheader.h"
+2 -2
View File
@@ -6,7 +6,6 @@
#include <QIcon>
class Timeline;
class ViewerWidget;
class Media;
struct Sequence;
class TimelineHeader;
@@ -17,6 +16,7 @@ class QPushButton;
class QLabel;
#include "project/marker.h"
#include "ui/viewerwidget.h"
bool frame_rate_is_droppable(float rate);
long timecode_to_frame(const QString& s, int view, double frame_rate);
@@ -27,7 +27,7 @@ class Viewer : public QDockWidget
Q_OBJECT
public:
explicit Viewer(QWidget *parent = 0);
explicit Viewer(QWidget *parent = nullptr);
~Viewer();
bool is_focused();