diff --git a/dialogs/newsequencedialog.cpp b/dialogs/newsequencedialog.cpp index 8f12077c6..47ead1336 100644 --- a/dialogs/newsequencedialog.cpp +++ b/dialogs/newsequencedialog.cpp @@ -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 #include #include @@ -40,6 +30,16 @@ #include #include +#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 } diff --git a/dialogs/texteditdialog.cpp b/dialogs/texteditdialog.cpp index c1fb194b3..31c841906 100644 --- a/dialogs/texteditdialog.cpp +++ b/dialogs/texteditdialog.cpp @@ -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;icount();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;icount();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); + } } diff --git a/effects/effect.cpp b/effects/effect.cpp index 895915697..e5f356cf3 100644 --- a/effects/effect.cpp +++ b/effects/effect.cpp @@ -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(); diff --git a/effects/fields/doublefield.cpp b/effects/fields/doublefield.cpp index a62836c52..ecbadc827 100644 --- a/effects/fields/doublefield.cpp +++ b/effects/fields/doublefield.cpp @@ -38,7 +38,6 @@ void DoubleField::SetDefault(double d) if (!value_set_) { SetValueAt(0, d); - value_set_ = false; } } diff --git a/ui/effectui.cpp b/ui/effectui.cpp index 4cbee4fa7..feeb0334b 100644 --- a/ui/effectui.cpp +++ b/ui/effectui.cpp @@ -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;imapToGlobal(pos)); }