Skip to content

Commit

Permalink
Timeline: support status bar message
Browse files Browse the repository at this point in the history
Ref: #319
  • Loading branch information
rodlie committed Nov 12, 2024
1 parent 9837cff commit 4e824b1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/app/GUI/graphboxeslist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,11 @@ void KeysView::graphEasingApply(QrealAnimator *anim,
{
if (!anim) { return; }
if (const auto spa = enve_cast<SmartPathAnimator*>(anim)) {
qDebug() << "SmartPathAnimator does not support expressions";
// emit a warning or something
emit statusMessage(tr("Smart paths does not support easing"));
return;
}
if (!graphEasingApplyExpression(anim, range, easing)) {
qDebug() << "Failed to apply expression on" << anim->prp_getName() << range.fMin << range.fMax;
// emit a warning or something
emit statusMessage(tr("Failed to apply easing on %1").arg(anim->prp_getName()));
}
}

Expand Down
1 change: 1 addition & 0 deletions src/app/GUI/keysview.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ class KeysView : public QWidget, public KeyFocusTarget {
signals:
void changedViewedFrames(FrameRange);
void wheelEventSignal(QWheelEvent*);
void statusMessage(const QString &message);
public:
static QColor sGetAnimatorColor(const int i);

Expand Down
8 changes: 8 additions & 0 deletions src/app/GUI/timelinewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <QToolButton>
#include <QStackedLayout>
#include <QDesktopWidget>
#include <QStatusBar>

#include "timelinewidget.h"
#include "widgets/framescrollbar.h"
Expand Down Expand Up @@ -202,6 +203,13 @@ TimelineWidget::TimelineWidget(Document &document,
mKeysView = new KeysView(mBoxesListWidget, this);
mKeysViewLayout->addWidget(mKeysView);

connect(mKeysView, &KeysView::statusMessage,
this, [](const QString &message) {
if (MainWindow::sGetInstance()->statusBar()) {
MainWindow::sGetInstance()->statusBar()->showMessage(message, 5000);
}
});

const auto high1 = mBoxesListWidget->requestHighlighter();
const auto high2 = mKeysView->requestHighlighter();
high1->setOther(high2);
Expand Down

0 comments on commit 4e824b1

Please sign in to comment.