implemented undos for effect fields that aren't keyframed

This commit is contained in:
itsmattkc
2018-09-20 21:34:36 +10:00
parent 4e57b1c26d
commit b1c3f44b04
15 changed files with 122 additions and 17 deletions
+7 -8
View File
@@ -15,10 +15,15 @@ QColor ColorButton::get_color() {
}
void ColorButton::set_color(QColor c) {
previousColor = color;
color = c;
set_button_color();
}
const QColor &ColorButton::getPreviousValue() {
return previousColor;
}
void ColorButton::set_button_color() {
QPalette pal = palette();
pal.setColor(QPalette::Button, color);
@@ -26,16 +31,10 @@ void ColorButton::set_button_color() {
}
void ColorButton::open_dialog() {
QColor old_color = color;
QColor new_color = QColorDialog::getColor(color, NULL);
if (new_color.isValid() && old_color != new_color) {
ColorCommand* command = new ColorCommand(this, old_color, new_color);
// undo_stack.push(command);
command->redo();
delete command;
if (new_color.isValid() && color != new_color) {
set_color(new_color);
set_button_color();
emit color_changed();
}
}