implement document resize with menu and dialog
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "app.h"
|
||||
#include "node_dialog_open.h"
|
||||
#include "node_dialog_browse.h"
|
||||
#include "node_dialog_resize.h"
|
||||
#include "node_dialog_cloud.h"
|
||||
#include "node_about.h"
|
||||
#include "node_changelog.h"
|
||||
@@ -244,8 +245,11 @@ void App::dialog_browse()
|
||||
|
||||
dialog->btn_ok->on_click = [this, dialog](Node*)
|
||||
{
|
||||
open_document(dialog->selected_path);
|
||||
dialog->destroy();
|
||||
if (dialog->is_selected())
|
||||
{
|
||||
open_document(dialog->selected_path);
|
||||
dialog->destroy();
|
||||
}
|
||||
};
|
||||
async_end();
|
||||
};
|
||||
@@ -389,6 +393,30 @@ void App::dialog_export()
|
||||
}
|
||||
}
|
||||
|
||||
void App::dialog_resize()
|
||||
{
|
||||
auto dialog = std::make_shared<NodeDialogResize>();
|
||||
dialog->m_manager = &layout;
|
||||
dialog->init();
|
||||
dialog->create();
|
||||
dialog->loaded();
|
||||
|
||||
layout[main_id]->add_child(dialog);
|
||||
layout[main_id]->update();
|
||||
|
||||
dialog->btn_ok->on_click = [this,dialog](Node*)
|
||||
{
|
||||
int res = dialog->get_resolution();
|
||||
if (canvas)
|
||||
canvas->m_canvas->resize(res, res);
|
||||
App::I.title_update();
|
||||
dialog->destroy();
|
||||
};
|
||||
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
}
|
||||
|
||||
void App::dialog_export_cubes()
|
||||
{
|
||||
if (canvas)
|
||||
|
||||
Reference in New Issue
Block a user