Merge branch 'master' of https://github.com/olive-editor/olive into furtherocio

This commit is contained in:
itsmattkc
2019-03-17 10:42:43 +11:00
5 changed files with 62 additions and 35 deletions
+10 -10
View File
@@ -20,16 +20,6 @@
#include "newsequencedialog.h"
#include "panels/panels.h"
#include "panels/project.h"
#include "timeline/sequence.h"
#include "undo/undostack.h"
#include "undo/undo.h"
#include "timeline/clip.h"
#include "panels/timeline.h"
#include "project/media.h"
#include "rendering/audio.h"
#include <QVariant>
#include <QVBoxLayout>
#include <QComboBox>
@@ -40,6 +30,16 @@
#include <QLineEdit>
#include <QDialogButtonBox>
#include "panels/panels.h"
#include "panels/project.h"
#include "timeline/sequence.h"
#include "undo/undostack.h"
#include "undo/undo.h"
#include "timeline/clip.h"
#include "panels/timeline.h"
#include "project/media.h"
#include "rendering/audio.h"
extern "C" {
#include <libavcodec/avcodec.h>
}
+19 -17
View File
@@ -213,24 +213,26 @@ void TextEditDialog::SetAlignmentFromProperty()
void TextEditDialog::UpdateUIFromTextCursor()
{
italic_button->setChecked(textEdit->fontItalic());
underline_button->setChecked(textEdit->fontUnderline());
font_list->setCurrentText(textEdit->fontFamily());
font_size->SetValue(textEdit->fontPointSize());
font_color->set_color(textEdit->textColor());
if (rich_text_) {
italic_button->setChecked(textEdit->fontItalic());
underline_button->setChecked(textEdit->fontUnderline());
font_list->setCurrentText(textEdit->fontFamily());
font_size->SetValue(textEdit->fontPointSize());
font_color->set_color(textEdit->textColor());
for (int i=0;i<font_weight->count();i++) {
if (font_weight->itemData(i).toInt() == textEdit->fontWeight()) {
font_weight->blockSignals(true);
font_weight->setCurrentIndex(i);
font_weight->blockSignals(false);
break;
for (int i=0;i<font_weight->count();i++) {
if (font_weight->itemData(i).toInt() == textEdit->fontWeight()) {
font_weight->blockSignals(true);
font_weight->setCurrentIndex(i);
font_weight->blockSignals(false);
break;
}
}
}
Qt::Alignment align = textEdit->alignment();
left_align_button->setChecked(align == Qt::AlignLeft);
center_align_button->setChecked(align == Qt::AlignCenter);
right_align_button->setChecked(align == Qt::AlignRight);
justify_align_button->setChecked(align == Qt::AlignJustify);
Qt::Alignment align = textEdit->alignment();
left_align_button->setChecked(align == Qt::AlignLeft);
center_align_button->setChecked(align == Qt::AlignCenter);
right_align_button->setChecked(align == Qt::AlignRight);
justify_align_button->setChecked(align == Qt::AlignJustify);
}
}
+12 -2
View File
@@ -416,9 +416,14 @@ void Effect::delete_self() {
}
void Effect::move_up() {
int index_of_effect = parent_clip->IndexOfEffect(this);
if (index_of_effect == 0) {
return;
}
MoveEffectCommand* command = new MoveEffectCommand();
command->clip = parent_clip;
command->from = parent_clip->IndexOfEffect(this);
command->from = index_of_effect;
command->to = command->from - 1;
olive::UndoStack.push(command);
panel_effect_controls->Reload();
@@ -426,9 +431,14 @@ void Effect::move_up() {
}
void Effect::move_down() {
int index_of_effect = parent_clip->IndexOfEffect(this);
if (index_of_effect == parent_clip->effects.size()-1) {
return;
}
MoveEffectCommand* command = new MoveEffectCommand();
command->clip = parent_clip;
command->from = parent_clip->IndexOfEffect(this);
command->from = index_of_effect;
command->to = command->from + 1;
olive::UndoStack.push(command);
panel_effect_controls->Reload();
-1
View File
@@ -38,7 +38,6 @@ void DoubleField::SetDefault(double d)
if (!value_set_) {
SetValueAt(0, d);
value_set_ = false;
}
}
+21 -5
View File
@@ -289,23 +289,39 @@ void EffectUI::show_context_menu(const QPoint& pos) {
menu.addSeparator();
QAction* move_up_action = nullptr;
QAction* move_down_action = nullptr;
if (index > 0) {
menu.addAction(tr("Move &Up"), this, SLOT(move_up()));
move_up_action = menu.addAction(tr("Move &Up"), GetEffect(), SLOT(move_up()));
}
if (index < c->effects.size() - 1) {
menu.addAction(tr("Move &Down"), this, SLOT(move_down()));
move_down_action = menu.addAction(tr("Move &Down"), GetEffect(), SLOT(move_down()));
}
menu.addSeparator();
menu.addAction(tr("D&elete"), this, SLOT(delete_self()));
QAction* delete_action = menu.addAction(tr("D&elete"), GetEffect(), SLOT(delete_self()));
// Loop through additional effects and link these too
for (int i=0;i<additional_effects_.size();i++) {
if (move_up_action != nullptr) {
connect(move_up_action, SIGNAL(triggered(bool)), additional_effects_.at(i), SLOT(move_up()));
}
if (move_down_action != nullptr) {
connect(move_down_action, SIGNAL(triggered(bool)), additional_effects_.at(i), SLOT(move_down()));
}
connect(delete_action, SIGNAL(triggered(bool)), additional_effects_.at(i), SLOT(delete_self()));
}
menu.addSeparator();
menu.addAction(tr("Load Settings From File"), this, SLOT(load_from_file()));
menu.addAction(tr("Load Settings From File"), GetEffect(), SLOT(load_from_file()));
menu.addAction(tr("Save Settings to File"), this, SLOT(save_to_file()));
menu.addAction(tr("Save Settings to File"), GetEffect(), SLOT(save_to_file()));
menu.exec(title_bar->mapToGlobal(pos));
}