Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Jun 28, 2024
1 parent f1f6ba8 commit ea38730
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
24 changes: 9 additions & 15 deletions src/app/GUI/timelinedockwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,6 @@ TimelineDockWidget::TimelineDockWidget(Document& document,
mMainLayout->setSpacing(0);
mMainLayout->setMargin(0);

mFrameMarkersAct = new QAction(/*QIcon::fromTheme("dots"),*/
tr("M"),
this);
mFrameMarkersAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts",
"addMarker",
"k").toString())); // 'm' already in use
connect(mFrameMarkersAct, &QAction::triggered,
this, [this]() {
const auto scene = *mDocument.fActiveScene;
if (!scene) { return; }
const auto frame = scene->getCurrentFrame();
scene->setMarker(tr("Marker"), frame);
});

mFrameRewindAct = new QAction(QIcon::fromTheme("rewind"),
tr("Rewind"),
this);
Expand Down Expand Up @@ -266,7 +252,6 @@ TimelineDockWidget::TimelineDockWidget(Document& document,
mToolBar->addAction(mPlayButton);
mToolBar->addAction(mStopButton);
mToolBar->addAction(mLoopButton);
mToolBar->addAction(mFrameMarkersAct);

mRenderProgressAct->setVisible(false);

Expand Down Expand Up @@ -333,6 +318,7 @@ void TimelineDockWidget::setLoop(const bool loop)
RenderHandler::sInstance->setLoop(loop);
}

// TODO: marker shortcut
bool TimelineDockWidget::processKeyPress(QKeyEvent *event)
{
const int key = event->key();
Expand Down Expand Up @@ -591,3 +577,11 @@ void TimelineDockWidget::setOut()
bool apply = (scene->getFrameOut().second != frame);
scene->setFrameOut(apply, frame);
}

void TimelineDockWidget::setMarker()
{
const auto scene = *mDocument.fActiveScene;
if (!scene) { return; }
const auto frame = scene->getCurrentFrame();
scene->setMarker(tr("Marker"), frame);
}
3 changes: 1 addition & 2 deletions src/app/GUI/timelinedockwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class TimelineDockWidget : public QWidget

void setIn();
void setOut();
void setMarker();

private:
void setLoop(const bool loop);
Expand Down Expand Up @@ -126,8 +127,6 @@ class TimelineDockWidget : public QWidget
QAction *mRenderProgressAct;
QProgressBar *mRenderProgress;

QAction *mFrameMarkersAct;

QList<TimelineWidget*> mTimelineWidgets;
//AnimationDockWidget *mAnimationDockWidget;
};
Expand Down

0 comments on commit ea38730

Please sign in to comment.