mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-16 14:42:44 +00:00
Fix UIConext::isUiAvailable() for batch mode
This commit is contained in:
parent
94a642cd36
commit
a1fd08789a
@ -67,8 +67,16 @@ UIContext::~UIContext()
|
||||
ASSERT(documents().empty());
|
||||
}
|
||||
|
||||
bool UIContext::isUiAvailable() const
|
||||
{
|
||||
return App::instance()->isGui();
|
||||
}
|
||||
|
||||
DocumentView* UIContext::activeView() const
|
||||
{
|
||||
if (!isUiAvailable())
|
||||
return NULL;
|
||||
|
||||
Workspace* workspace = App::instance()->getMainWindow()->getWorkspace();
|
||||
WorkspaceView* view = workspace->activeView();
|
||||
if (DocumentView* docView = dynamic_cast<DocumentView*>(view))
|
||||
|
@ -36,7 +36,7 @@ namespace app {
|
||||
UIContext();
|
||||
virtual ~UIContext();
|
||||
|
||||
virtual bool isUiAvailable() const { return true; }
|
||||
bool isUiAvailable() const override;
|
||||
|
||||
DocumentView* activeView() const;
|
||||
void setActiveView(DocumentView* documentView);
|
||||
|
Loading…
x
Reference in New Issue
Block a user