Centralize retained dialog cancel bindings
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user