Skip to content

Commit

Permalink
Scrubs to new frame when spinbox value changes
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlamhauge committed Mar 14, 2024
1 parent c24322e commit a24b886
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/src/mainwindow2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ GNU General Public License for more details.
*/

#include "mainwindow2.h"
#include "previewframesdialog.h"
#include "ui_mainwindow2.h"

// Qt headers
Expand Down Expand Up @@ -68,6 +67,7 @@ GNU General Public License for more details.
#include "onionskinwidget.h"
#include "pegbaralignmentdialog.h"
#include "repositionframesdialog.h"
#include "previewframesdialog.h"

//#include "preview.h"
#include "errordialog.h"
Expand Down Expand Up @@ -968,9 +968,10 @@ void MainWindow2::previewFrames()
if (layer->type() == Layer::SOUND || layer->type() == Layer::CAMERA)
return;

int maxFrame = layer->getMaxKeyFramePosition();
PreviewFramesDialog* preview = new PreviewFramesDialog(maxFrame, currFrame);
preview->open();
int maxFrame = mEditor->layers()->animationLength(true);
mPreviewFramesDialog = new PreviewFramesDialog(maxFrame, currFrame);
connect(mPreviewFramesDialog, &PreviewFramesDialog::currentFrameChanged, mEditor, &Editor::scrubTo);
mPreviewFramesDialog->exec();
}

void MainWindow2::lockWidgets(bool shouldLock)
Expand Down
1 change: 1 addition & 0 deletions app/src/previewframesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ PreviewFramesDialog::~PreviewFramesDialog()
void PreviewFramesDialog::frameChanged(int frame)
{
setCurrentFrame(frame);
currentFrameChanged(frame);
ui->labFrame->setText(QString::number(frame));
}

0 comments on commit a24b886

Please sign in to comment.