mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-22 15:39:52 +00:00
Merge pull request #648 from blackmiaool/patch-2
Show checkbox in View > Timeline menu item when the Timeline is visible
This commit is contained in:
commit
9bf11e0b40
@ -28,6 +28,7 @@ public:
|
||||
protected:
|
||||
void onLoadParams(const Params& params) override;
|
||||
void onExecute(Context* context) override;
|
||||
bool onChecked(Context* ctx) override;
|
||||
|
||||
bool m_open;
|
||||
bool m_close;
|
||||
@ -75,6 +76,15 @@ void TimelineCommand::onExecute(Context* context)
|
||||
App::instance()->getMainWindow()->setTimelineVisibility(newVisible);
|
||||
}
|
||||
|
||||
bool TimelineCommand::onChecked(Context* ctx) {
|
||||
MainWindow* mainWin = App::instance()->getMainWindow();
|
||||
if (!mainWin)
|
||||
return false;
|
||||
|
||||
Timeline* timelineWin = mainWin->getTimeline();
|
||||
return (timelineWin && timelineWin->isVisible());
|
||||
}
|
||||
|
||||
Command* CommandFactory::createTimelineCommand()
|
||||
{
|
||||
return new TimelineCommand;
|
||||
|
Loading…
x
Reference in New Issue
Block a user