Centralize retained dialog cancel bindings
This commit is contained in:
@@ -30,9 +30,7 @@ void NodeDialogBrowse::init_controls()
|
||||
{
|
||||
btn_ok = find<NodeButton>("btn-ok");
|
||||
btn_cancel = find<NodeButton>("btn-cancel");
|
||||
btn_cancel->on_click = [this](Node*) {
|
||||
destroy();
|
||||
};
|
||||
pp::panopainter::bind_legacy_click_destroys_node(*btn_cancel, *this);
|
||||
btn_delete = find<NodeButton>("btn-delete");
|
||||
btn_delete->on_click = [this](Node*) {
|
||||
if (!current)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "node_message_box.h"
|
||||
#include "app.h"
|
||||
#include "image.h"
|
||||
#include "legacy_ui_overlay_services.h"
|
||||
#include "platform_api/network_tls_policy.h"
|
||||
|
||||
Node* NodeDialogCloud::clone_instantiate() const
|
||||
@@ -30,9 +31,7 @@ void NodeDialogCloud::init_controls()
|
||||
{
|
||||
btn_ok = find<NodeButton>("btn-ok");
|
||||
btn_cancel = find<NodeButton>("btn-cancel");
|
||||
btn_cancel->on_click = [this](Node*) {
|
||||
destroy();
|
||||
};
|
||||
pp::panopainter::bind_legacy_click_destroys_node(*btn_cancel, *this);
|
||||
container = find<Node>("files-list");
|
||||
std::thread(&NodeDialogCloud::load_thumbs_thread, this).detach();
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "node_dialog_export_ppbr.h"
|
||||
#include "app.h"
|
||||
#include "image.h"
|
||||
#include "legacy_ui_overlay_services.h"
|
||||
|
||||
Node* NodeDialogExportPPBR::clone_instantiate() const
|
||||
{
|
||||
@@ -30,9 +31,7 @@ void NodeDialogExportPPBR::init_controls()
|
||||
m_dest_path_txt->SetVisibility(false);
|
||||
btn_ok = find<NodeButton>("btn-ok");
|
||||
btn_cancel = find<NodeButton>("btn-cancel");
|
||||
btn_cancel->on_click = [this](Node*) {
|
||||
destroy();
|
||||
};
|
||||
pp::panopainter::bind_legacy_click_destroys_node(*btn_cancel, *this);
|
||||
btn_header_open = find<NodeButton>("header-open");
|
||||
btn_header_open->on_click = [this] (Node*) {
|
||||
open_header();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "log.h"
|
||||
#include "node_dialog_layer_rename.h"
|
||||
#include "canvas.h"
|
||||
#include "legacy_ui_overlay_services.h"
|
||||
#include "node_image_texture.h"
|
||||
|
||||
Node* NodeDialogLayerRename::clone_instantiate() const
|
||||
@@ -26,9 +27,7 @@ void NodeDialogLayerRename::init_controls()
|
||||
btn_ok = find<NodeButton>("btn-ok");
|
||||
btn_cancel = find<NodeButton>("btn-cancel");
|
||||
input = find<NodeTextInput>("txt-input");
|
||||
btn_cancel->on_click = [this](Node*) {
|
||||
destroy();
|
||||
};
|
||||
pp::panopainter::bind_legacy_click_destroys_node(*btn_cancel, *this);
|
||||
}
|
||||
|
||||
void NodeDialogLayerRename::loaded()
|
||||
|
||||
@@ -32,9 +32,7 @@ void NodeDialogOpen::init_controls()
|
||||
{
|
||||
btn_ok = find<NodeButton>("btn-ok");
|
||||
btn_cancel = find<NodeButton>("btn-cancel");
|
||||
btn_cancel->on_click = [this](Node*) {
|
||||
destroy();
|
||||
};
|
||||
pp::panopainter::bind_legacy_click_destroys_node(*btn_cancel, *this);
|
||||
btn_delete = find<NodeButton>("btn-delete");
|
||||
btn_delete->on_click = [this](Node*) {
|
||||
if (!current)
|
||||
@@ -179,9 +177,7 @@ void NodeDialogSave::init_controls()
|
||||
{
|
||||
btn_ok = find<NodeButton>("btn-ok");
|
||||
btn_cancel = find<NodeButton>("btn-cancel");
|
||||
btn_cancel->on_click = [this](Node*) {
|
||||
destroy();
|
||||
};
|
||||
pp::panopainter::bind_legacy_click_destroys_node(*btn_cancel, *this);
|
||||
input = find<NodeTextInput>("txt-input");
|
||||
input->on_return = [&](NodeTextInput* target){
|
||||
if (btn_ok->on_click)
|
||||
@@ -240,9 +236,7 @@ void NodeDialogNewDoc::init_controls()
|
||||
btn_ok = find<NodeButton>("btn-ok");
|
||||
m_resolution = find<NodeComboBox>("resolution");
|
||||
btn_cancel = find<NodeButton>("btn-cancel");
|
||||
btn_cancel->on_click = [this](Node*) {
|
||||
destroy();
|
||||
};
|
||||
pp::panopainter::bind_legacy_click_destroys_node(*btn_cancel, *this);
|
||||
input = find<NodeTextInput>("txt-input");
|
||||
input->on_return = [&](NodeTextInput* target){
|
||||
if (btn_ok->on_click)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "node_dialog_resize.h"
|
||||
#include "app_core/document_resize.h"
|
||||
#include "canvas.h"
|
||||
#include "legacy_ui_overlay_services.h"
|
||||
#include "node_image_texture.h"
|
||||
#include <array>
|
||||
|
||||
@@ -36,9 +37,7 @@ void NodeDialogResize::init_controls()
|
||||
&& state.current_resolution_index < static_cast<int>(combo->m_items.size())) {
|
||||
combo->m_current_index = state.current_resolution_index;
|
||||
}
|
||||
btn_cancel->on_click = [this](Node*) {
|
||||
destroy();
|
||||
};
|
||||
pp::panopainter::bind_legacy_click_destroys_node(*btn_cancel, *this);
|
||||
}
|
||||
|
||||
void NodeDialogResize::loaded()
|
||||
|
||||
Reference in New Issue
Block a user