implement save request on OSX, add Quick Look extentions

This commit is contained in:
2018-07-31 00:38:10 +02:00
parent 87fcea61b8
commit 5a37f578cb
18 changed files with 814 additions and 20 deletions

View File

@@ -33,7 +33,9 @@ void App::create()
bool App::request_close()
{
static bool dialog_already_opened = false;
if (ui::Canvas::I->m_unsaved && !dialog_already_opened)
if (!ui::Canvas::I->m_unsaved)
return true;
if (!dialog_already_opened)
{
async_start();
auto* m = layout[main_id]->add_child<NodeMessageBox>();
@@ -43,9 +45,15 @@ bool App::request_close()
m->btn_ok->on_click = [](Node*) {
};
m->btn_cancel->m_text->set_text("No");
m->btn_cancel->on_click = [](Node*) {
m->btn_cancel->on_click = [this](Node*) {
#ifdef _WIN32
destroy_window();
PostQuitMessage(0);
#endif
#ifdef __OSX__
[osx_view close];
#endif
ui::Canvas::I->m_unsaved = false;
};
async_redraw();
async_end();