Centralize retained popup closing
This commit is contained in:
@@ -678,50 +678,42 @@ void App::init_menu_file()
|
||||
if (auto b = popup->find<NodeButtonCustom>("file-newdoc"))
|
||||
b->on_click = [this, popup](Node*) {
|
||||
apply_file_menu_plan(*this, pp::app::FileMenuCommand::new_document);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
};
|
||||
if (auto b = popup->find<NodeButtonCustom>("file-import"))
|
||||
b->on_click = [this, popup](Node*) {
|
||||
apply_file_menu_plan(*this, pp::app::FileMenuCommand::import_image);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
};
|
||||
if (auto b = popup->find<NodeButtonCustom>("file-open"))
|
||||
b->on_click = [this, popup](Node*) {
|
||||
apply_file_menu_plan(*this, pp::app::FileMenuCommand::open_project);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
};
|
||||
if (auto b = popup->find<NodeButtonCustom>("file-browse"))
|
||||
b->on_click = [this, popup](Node*) {
|
||||
apply_file_menu_plan(*this, pp::app::FileMenuCommand::browse_cloud);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
};
|
||||
if (auto b = popup->find<NodeButtonCustom>("file-save"))
|
||||
b->on_click = [this, popup](Node*) {
|
||||
apply_file_menu_plan(*this, pp::app::FileMenuCommand::save);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
};
|
||||
if (auto b = popup->find<NodeButtonCustom>("file-save-as"))
|
||||
b->on_click = [this, popup](Node*) {
|
||||
apply_file_menu_plan(*this, pp::app::FileMenuCommand::save_as);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
};
|
||||
if (auto b = popup->find<NodeButtonCustom>("file-save-ver"))
|
||||
b->on_click = [this, popup](Node*) {
|
||||
apply_file_menu_plan(*this, pp::app::FileMenuCommand::save_version);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
};
|
||||
if (auto b = popup->find<NodeButtonCustom>("file-export"))
|
||||
b->on_click = [this, popup](Node*) {
|
||||
apply_file_menu_plan(*this, pp::app::FileMenuCommand::export_jpeg);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
};
|
||||
if (auto b = popup->find<NodeButtonCustom>("file-export-tick"))
|
||||
b->on_click = [this, b, popup](Node*) {
|
||||
@@ -731,77 +723,59 @@ void App::init_menu_file()
|
||||
return;
|
||||
subpopup->find<NodeButtonCustom>("file-submenu-export-png")->on_click = [this, subpopup, popup](Node*) {
|
||||
apply_document_export_menu_plan(*this, pp::app::DocumentExportMenuKind::png);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
subpopup->mouse_release();
|
||||
subpopup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
pp::panopainter::close_legacy_popup_overlay(*subpopup);
|
||||
};
|
||||
subpopup->find<NodeButtonCustom>("file-submenu-export-layers")->on_click = [this, subpopup, popup](Node*) {
|
||||
apply_document_export_menu_plan(*this, pp::app::DocumentExportMenuKind::layers);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
subpopup->mouse_release();
|
||||
subpopup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
pp::panopainter::close_legacy_popup_overlay(*subpopup);
|
||||
};
|
||||
subpopup->find<NodeButtonCustom>("file-submenu-export-cube")->on_click = [this, subpopup, popup](Node*) {
|
||||
apply_document_export_menu_plan(*this, pp::app::DocumentExportMenuKind::cube_faces);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
subpopup->mouse_release();
|
||||
subpopup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
pp::panopainter::close_legacy_popup_overlay(*subpopup);
|
||||
};
|
||||
subpopup->find<NodeButtonCustom>("file-submenu-export-depth")->on_click = [this, subpopup, popup](Node*) {
|
||||
apply_document_export_menu_plan(*this, pp::app::DocumentExportMenuKind::depth);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
subpopup->mouse_release();
|
||||
subpopup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
pp::panopainter::close_legacy_popup_overlay(*subpopup);
|
||||
};
|
||||
subpopup->find<NodeButtonCustom>("file-submenu-export-anim")->on_click = [this, subpopup, popup](Node*) {
|
||||
apply_document_export_menu_plan(*this, pp::app::DocumentExportMenuKind::animation_frames);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
subpopup->mouse_release();
|
||||
subpopup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
pp::panopainter::close_legacy_popup_overlay(*subpopup);
|
||||
};
|
||||
subpopup->find<NodeButtonCustom>("file-submenu-export-anim-mp4")->on_click = [this, subpopup, popup](Node*) {
|
||||
apply_document_export_menu_plan(*this, pp::app::DocumentExportMenuKind::animation_mp4);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
subpopup->mouse_release();
|
||||
subpopup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
pp::panopainter::close_legacy_popup_overlay(*subpopup);
|
||||
};
|
||||
subpopup->find<NodeButtonCustom>("file-submenu-export-timelapse")->on_click = [this, subpopup, popup](Node*) {
|
||||
apply_document_export_menu_plan(*this, pp::app::DocumentExportMenuKind::timelapse);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
subpopup->mouse_release();
|
||||
subpopup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
pp::panopainter::close_legacy_popup_overlay(*subpopup);
|
||||
};
|
||||
};
|
||||
if (auto b = popup->find<NodeButtonCustom>("file-share"))
|
||||
b->on_click = [this, popup](Node*) {
|
||||
apply_file_menu_plan(*this, pp::app::FileMenuCommand::share);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
};
|
||||
if (auto b = popup->find<NodeButtonCustom>("file-resize"))
|
||||
b->on_click = [this, popup](Node*) {
|
||||
apply_file_menu_plan(*this, pp::app::FileMenuCommand::resize);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
};
|
||||
if (auto b = popup->find<NodeButtonCustom>("file-cloud-upload"))
|
||||
b->on_click = [this, popup](Node*) {
|
||||
apply_file_menu_plan(*this, pp::app::FileMenuCommand::cloud_upload);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
};
|
||||
if (auto b = popup->find<NodeButtonCustom>("file-cloud-browse"))
|
||||
b->on_click = [this, popup](Node*) {
|
||||
apply_file_menu_plan(*this, pp::app::FileMenuCommand::cloud_browse);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -880,8 +854,8 @@ void App::init_menu_tools()
|
||||
{
|
||||
fpanel->m_container->add_child(floating_presets);
|
||||
}
|
||||
popup_exp->destroy();
|
||||
popup_time->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup_exp);
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup_time);
|
||||
};
|
||||
|
||||
popup_time->find<NodeButtonCustom>("panel-color")->on_click = [this, popup_time, popup_exp, visible](Node*) {
|
||||
@@ -908,8 +882,8 @@ void App::init_menu_tools()
|
||||
{
|
||||
fpanel->m_container->add_child(floating_color);
|
||||
}
|
||||
popup_exp->destroy();
|
||||
popup_time->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup_exp);
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup_time);
|
||||
};
|
||||
popup_time->find<NodeButtonCustom>("panel-color-adv")->on_click = [this, popup_time, popup_exp, visible](Node*) {
|
||||
const auto plan = pp::app::plan_tools_panel(
|
||||
@@ -935,8 +909,8 @@ void App::init_menu_tools()
|
||||
{
|
||||
fpanel->m_container->add_child(floating_picker);
|
||||
}
|
||||
popup_exp->destroy();
|
||||
popup_time->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup_exp);
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup_time);
|
||||
};
|
||||
popup_time->find<NodeButtonCustom>("panel-layers")->on_click = [this, popup_time, popup_exp, visible](Node*) {
|
||||
const auto plan = pp::app::plan_tools_panel(
|
||||
@@ -956,8 +930,8 @@ void App::init_menu_tools()
|
||||
if (plan.hides_embedded_title)
|
||||
layers->find("title")->SetVisibility(false);
|
||||
|
||||
popup_exp->destroy();
|
||||
popup_time->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup_exp);
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup_time);
|
||||
};
|
||||
popup_time->find<NodeButtonCustom>("panel-brush")->on_click = [this, popup_time, popup_exp, visible](Node*) {
|
||||
const auto plan = pp::app::plan_tools_panel(
|
||||
@@ -976,8 +950,8 @@ void App::init_menu_tools()
|
||||
if (plan.hides_embedded_title)
|
||||
stroke->find("title")->SetVisibility(false);
|
||||
|
||||
popup_exp->destroy();
|
||||
popup_time->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup_exp);
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup_time);
|
||||
};
|
||||
popup_time->find<NodeButtonCustom>("panel-grids")->on_click = [this, popup_time, popup_exp, visible](Node*) {
|
||||
const auto plan = pp::app::plan_tools_panel(
|
||||
@@ -996,8 +970,8 @@ void App::init_menu_tools()
|
||||
if (plan.hides_embedded_title)
|
||||
grid->find("title")->SetVisibility(false);
|
||||
|
||||
popup_exp->destroy();
|
||||
popup_time->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup_exp);
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup_time);
|
||||
};
|
||||
popup_time->find<NodeButtonCustom>("panel-animation")->on_click = [this, popup_time, popup_exp, visible](Node*) {
|
||||
const auto plan = pp::app::plan_tools_panel(
|
||||
@@ -1014,8 +988,8 @@ void App::init_menu_tools()
|
||||
animation->SetWidthP(100);
|
||||
animation->SetHeightP(100);
|
||||
|
||||
popup_exp->destroy();
|
||||
popup_time->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup_exp);
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup_time);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1179,8 +1153,7 @@ void App::init_menu_tools()
|
||||
execute_tools_menu_plan(*this, plan);
|
||||
if (plan.closes_root_popup)
|
||||
{
|
||||
popup_exp->mouse_release();
|
||||
popup_exp->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup_exp);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1189,8 +1162,7 @@ void App::init_menu_tools()
|
||||
execute_tools_menu_plan(*this, plan);
|
||||
if (plan.closes_root_popup)
|
||||
{
|
||||
popup_exp->mouse_release();
|
||||
popup_exp->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup_exp);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1199,16 +1171,14 @@ void App::init_menu_tools()
|
||||
execute_tools_menu_plan(*this, plan);
|
||||
if (plan.closes_root_popup)
|
||||
{
|
||||
popup_exp->mouse_release();
|
||||
popup_exp->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup_exp);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
popup_exp->find<NodeButtonCustom>("mp4test")->on_click = [this, popup_exp](Node*) {
|
||||
dialog_export_mp4();
|
||||
popup_exp->mouse_release();
|
||||
popup_exp->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup_exp);
|
||||
};
|
||||
*/
|
||||
|
||||
@@ -1221,8 +1191,7 @@ void App::init_menu_tools()
|
||||
execute_tools_menu_plan(*this, plan);
|
||||
if (plan.closes_root_popup)
|
||||
{
|
||||
popup_exp->mouse_release();
|
||||
popup_exp->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup_exp);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1249,8 +1218,7 @@ void App::init_menu_about()
|
||||
execute_about_menu_plan(*this, plan);
|
||||
if (plan.closes_root_popup)
|
||||
{
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1265,8 +1233,7 @@ void App::init_menu_about()
|
||||
execute_about_menu_plan(*this, plan);
|
||||
if (plan.closes_root_popup)
|
||||
{
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1290,8 +1257,7 @@ void App::init_menu_about()
|
||||
execute_about_menu_plan(*this, plan);
|
||||
if (plan.closes_root_popup)
|
||||
{
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1307,8 +1273,7 @@ void App::init_menu_about()
|
||||
execute_about_menu_plan(*this, plan);
|
||||
if (plan.closes_root_popup)
|
||||
{
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1326,8 +1291,7 @@ void App::init_menu_about()
|
||||
execute_about_menu_plan(*this, plan);
|
||||
if (plan.closes_root_popup)
|
||||
{
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1406,8 +1370,7 @@ void App::init_menu_layer()
|
||||
popup->find<NodeButtonCustom>("layer-clear")->on_click = [this, popup](Node*) {
|
||||
const auto plan = make_layer_menu_plan(pp::app::DocumentLayerMenuCommand::clear, *this);
|
||||
execute_document_layer_menu_plan(*this, plan);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
};
|
||||
{
|
||||
const auto plan = make_layer_menu_plan(pp::app::DocumentLayerMenuCommand::clear, *this);
|
||||
@@ -1419,8 +1382,7 @@ void App::init_menu_layer()
|
||||
popup->find<NodeButtonCustom>("layer-rename")->on_click = [this, popup](Node*) {
|
||||
const auto plan = make_layer_menu_plan(pp::app::DocumentLayerMenuCommand::rename, *this);
|
||||
execute_document_layer_menu_plan(*this, plan);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
};
|
||||
{
|
||||
const auto plan = make_layer_menu_plan(pp::app::DocumentLayerMenuCommand::rename, *this);
|
||||
@@ -1432,8 +1394,7 @@ void App::init_menu_layer()
|
||||
popup->find<NodeButtonCustom>("layer-merge")->on_click = [this, popup](Node*) {
|
||||
const auto plan = make_layer_menu_plan(pp::app::DocumentLayerMenuCommand::merge_down, *this);
|
||||
execute_document_layer_menu_plan(*this, plan);
|
||||
popup->mouse_release();
|
||||
popup->destroy();
|
||||
pp::panopainter::close_legacy_popup_overlay(*popup);
|
||||
};
|
||||
{
|
||||
const auto plan = make_layer_menu_plan(pp::app::DocumentLayerMenuCommand::merge_down, *this);
|
||||
|
||||
Reference in New Issue
Block a user