stash SVGs that are continuously reused

This commit is contained in:
itsmattkc
2019-03-10 17:31:00 +11:00
parent 9fc1bc3e1d
commit d768871c2d
13 changed files with 248 additions and 184 deletions
+9 -8
View File
@@ -37,6 +37,7 @@
#include "io/clipboard.h"
#include "ui/sourcetable.h"
#include "ui/sourceiconview.h"
#include "ui/icons.h"
#include "ui/menuhelper.h"
#include "ui/mediaiconservice.h"
#include "project/sourcescommon.h"
@@ -102,31 +103,31 @@ Project::Project(QWidget *parent) :
toolbar->setSpacing(0);
QPushButton* toolbar_new = new QPushButton();
toolbar_new->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/add-button.svg")));
toolbar_new->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/add-button.svg")));
toolbar_new->setToolTip("New");
connect(toolbar_new, SIGNAL(clicked(bool)), this, SLOT(make_new_menu()));
toolbar->addWidget(toolbar_new);
QPushButton* toolbar_open = new QPushButton();
toolbar_open->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/open.svg")));
toolbar_open->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/open.svg")));
toolbar_open->setToolTip("Open Project");
connect(toolbar_open, SIGNAL(clicked(bool)), olive::Global.get(), SLOT(open_project()));
toolbar->addWidget(toolbar_open);
QPushButton* toolbar_save = new QPushButton();
toolbar_save->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/save.svg")));
toolbar_save->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/save.svg")));
toolbar_save->setToolTip("Save Project");
connect(toolbar_save, SIGNAL(clicked(bool)), olive::Global.get(), SLOT(save_project()));
toolbar->addWidget(toolbar_save);
QPushButton* toolbar_undo = new QPushButton();
toolbar_undo->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/undo.svg")));
toolbar_undo->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/undo.svg")));
toolbar_undo->setToolTip("Undo");
connect(toolbar_undo, SIGNAL(clicked(bool)), olive::Global.get(), SLOT(undo()));
toolbar->addWidget(toolbar_undo);
QPushButton* toolbar_redo = new QPushButton();
toolbar_redo->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/redo.svg")));
toolbar_redo->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/redo.svg")));
toolbar_redo->setToolTip("Redo");
connect(toolbar_redo, SIGNAL(clicked(bool)), olive::Global.get(), SLOT(redo()));
toolbar->addWidget(toolbar_redo);
@@ -137,13 +138,13 @@ Project::Project(QWidget *parent) :
toolbar->addWidget(toolbar_search);
QPushButton* toolbar_tree_view = new QPushButton();
toolbar_tree_view->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/treeview.svg")));
toolbar_tree_view->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/treeview.svg")));
toolbar_tree_view->setToolTip("Tree View");
connect(toolbar_tree_view, SIGNAL(clicked(bool)), this, SLOT(set_tree_view()));
toolbar->addWidget(toolbar_tree_view);
QPushButton* toolbar_icon_view = new QPushButton();
toolbar_icon_view->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/iconview.svg")));
toolbar_icon_view->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/iconview.svg")));
toolbar_icon_view->setToolTip("Icon View");
connect(toolbar_icon_view, SIGNAL(clicked(bool)), this, SLOT(set_icon_view()));
toolbar->addWidget(toolbar_icon_view);
@@ -174,7 +175,7 @@ Project::Project(QWidget *parent) :
icon_view_controls->setSpacing(0);
directory_up = new QPushButton();
directory_up->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/dirup.svg")));
directory_up->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/dirup.svg")));
directory_up->setEnabled(false);
icon_view_controls->addWidget(directory_up);
+14 -13
View File
@@ -26,6 +26,7 @@
#include "project/projectelements.h"
#include "ui/timelinewidget.h"
#include "ui/icons.h"
#include "ui/viewerwidget.h"
#include "rendering/audio.h"
#include "rendering/cacher.h"
@@ -1870,84 +1871,84 @@ void Timeline::setup_ui() {
tool_buttons_layout->setMargin(0);
toolArrowButton = new QPushButton();
toolArrowButton->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/arrow.svg")));
toolArrowButton->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/arrow.svg")));
toolArrowButton->setCheckable(true);
toolArrowButton->setProperty("tool", TIMELINE_TOOL_POINTER);
connect(toolArrowButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolArrowButton);
toolEditButton = new QPushButton();
toolEditButton->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/beam.svg")));
toolEditButton->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/beam.svg")));
toolEditButton->setCheckable(true);
toolEditButton->setProperty("tool", TIMELINE_TOOL_EDIT);
connect(toolEditButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolEditButton);
toolRippleButton = new QPushButton();
toolRippleButton->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/ripple.svg")));
toolRippleButton->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/ripple.svg")));
toolRippleButton->setCheckable(true);
toolRippleButton->setProperty("tool", TIMELINE_TOOL_RIPPLE);
connect(toolRippleButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolRippleButton);
toolRazorButton = new QPushButton();
toolRazorButton->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/razor.svg")));
toolRazorButton->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/razor.svg")));
toolRazorButton->setCheckable(true);
toolRazorButton->setProperty("tool", TIMELINE_TOOL_RAZOR);
connect(toolRazorButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolRazorButton);
toolSlipButton = new QPushButton();
toolSlipButton->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/slip.svg")));
toolSlipButton->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/slip.svg")));
toolSlipButton->setCheckable(true);
toolSlipButton->setProperty("tool", TIMELINE_TOOL_SLIP);
connect(toolSlipButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolSlipButton);
toolSlideButton = new QPushButton();
toolSlideButton->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/slide.svg")));
toolSlideButton->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/slide.svg")));
toolSlideButton->setCheckable(true);
toolSlideButton->setProperty("tool", TIMELINE_TOOL_SLIDE);
connect(toolSlideButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolSlideButton);
toolHandButton = new QPushButton();
toolHandButton->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/hand.svg")));
toolHandButton->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/hand.svg")));
toolHandButton->setCheckable(true);
toolHandButton->setProperty("tool", TIMELINE_TOOL_HAND);
connect(toolHandButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolHandButton);
toolTransitionButton = new QPushButton();
toolTransitionButton->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/transition-tool.svg")));
toolTransitionButton->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/transition-tool.svg")));
toolTransitionButton->setCheckable(true);
connect(toolTransitionButton, SIGNAL(clicked(bool)), this, SLOT(transition_tool_click()));
tool_buttons_layout->addWidget(toolTransitionButton);
snappingButton = new QPushButton();
snappingButton->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/magnet.svg")));
snappingButton->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/magnet.svg")));
snappingButton->setCheckable(true);
snappingButton->setChecked(true);
connect(snappingButton, SIGNAL(toggled(bool)), this, SLOT(snapping_clicked(bool)));
tool_buttons_layout->addWidget(snappingButton);
zoomInButton = new QPushButton();
zoomInButton->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/zoomin.svg")));
zoomInButton->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/zoomin.svg")));
connect(zoomInButton, SIGNAL(clicked(bool)), this, SLOT(zoom_in()));
tool_buttons_layout->addWidget(zoomInButton);
zoomOutButton = new QPushButton();
zoomOutButton->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/zoomout.svg")));
zoomOutButton->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/zoomout.svg")));
connect(zoomOutButton, SIGNAL(clicked(bool)), this, SLOT(zoom_out()));
tool_buttons_layout->addWidget(zoomOutButton);
recordButton = new QPushButton();
recordButton->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/record.svg")));
recordButton->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/record.svg")));
connect(recordButton, SIGNAL(clicked(bool)), this, SLOT(record_btn_click()));
tool_buttons_layout->addWidget(recordButton);
addButton = new QPushButton();
addButton->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/add-button.svg")));
addButton->setIcon(olive::icon::CreateIconFromSVG(QStringLiteral(":/icons/add-button.svg")));
connect(addButton, SIGNAL(clicked()), this, SLOT(add_btn_click()));
tool_buttons_layout->addWidget(addButton);
+11 -9
View File
@@ -37,6 +37,7 @@
#include "ui/labelslider.h"
#include "ui/timelineheader.h"
#include "ui/resizablescrollbar.h"
#include "ui/icons.h"
#include "oliveglobal.h"
#include "debug.h"
@@ -669,30 +670,27 @@ void Viewer::setup_ui() {
playback_control_layout->setMargin(0);
go_to_start_button = new QPushButton();
go_to_start_button->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/prev.svg")));
go_to_start_button->setIcon(olive::icon::ViewerGoToStart);
connect(go_to_start_button, SIGNAL(clicked(bool)), this, SLOT(go_to_in()));
playback_control_layout->addWidget(go_to_start_button);
prev_frame_button = new QPushButton();
prev_frame_button->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/rew.svg")));
prev_frame_button->setIcon(olive::icon::ViewerPrevFrame);
connect(prev_frame_button, SIGNAL(clicked(bool)), this, SLOT(previous_frame()));
playback_control_layout->addWidget(prev_frame_button);
play_icon_ = OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/play.svg"));
pause_icon_ = QPixmap(":/icons/pause.svg");
play_button = new QPushButton();
play_button->setIcon(play_icon_);
play_button->setIcon(olive::icon::ViewerPlay);
connect(play_button, SIGNAL(clicked(bool)), this, SLOT(toggle_play()));
playback_control_layout->addWidget(play_button);
next_frame_button = new QPushButton();
next_frame_button->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/ff.svg")));
next_frame_button->setIcon(olive::icon::ViewerNextFrame);
connect(next_frame_button, SIGNAL(clicked(bool)), this, SLOT(next_frame()));
playback_control_layout->addWidget(next_frame_button);
go_to_end_frame = new QPushButton();
go_to_end_frame->setIcon(OliveGlobal::CreateIconFromSVG(QStringLiteral(":/icons/next.svg")));
go_to_end_frame->setIcon(olive::icon::ViewerGoToEnd);
connect(go_to_end_frame, SIGNAL(clicked(bool)), this, SLOT(go_to_out()));
playback_control_layout->addWidget(go_to_end_frame);
@@ -737,6 +735,7 @@ void Viewer::set_media(Media* m) {
seq->workarea_out = footage->out;
}
// FIXME: Move this magic number to Config
seq->frame_rate = 30;
if (footage->video_tracks.size() > 0) {
@@ -750,6 +749,7 @@ void Viewer::set_media(Media* m) {
c->set_timeline_in(0);
c->set_timeline_out(footage->get_length_in_frames(seq->frame_rate));
if (c->timeline_out() <= 0) {
// FIXME: Move this magic number to Config
c->set_timeline_out(150);
}
c->set_track(-1);
@@ -757,6 +757,7 @@ void Viewer::set_media(Media* m) {
c->refresh();
seq->clips.append(c);
} else {
// FIXME: Move this magic number to Config
seq->width = 1920;
seq->height = 1080;
}
@@ -781,6 +782,7 @@ void Viewer::set_media(Media* m) {
viewer_widget->frame_update();
}
} else {
// FIXME: Move this magic number to Config
seq->audio_frequency = 48000;
}
@@ -907,5 +909,5 @@ void Viewer::set_sequence(bool main, SequencePtr s) {
}
void Viewer::set_playpause_icon(bool play) {
play_button->setIcon(play ? play_icon_ : pause_icon_);
play_button->setIcon(play ? olive::icon::ViewerPlay : olive::icon::ViewerPause);
}
-3
View File
@@ -142,9 +142,6 @@ private:
long get_seq_in();
long get_seq_out();
QIcon play_icon_;
QIcon pause_icon_;
void setup_ui();
ResizableScrollBar* horizontal_bar;