Centralize retained popup close decorations

This commit is contained in:
2026-06-12 15:10:16 +02:00
parent 4c7c48a22c
commit bbdc746426
6 changed files with 32 additions and 33 deletions

View File

@@ -490,9 +490,7 @@ void App::init_sidebar()
auto scroll = stroke->find<NodeScroll>("scroller");
//scroll->SetHeight(glm::max(100.f, screen.y - pos.y - 200.f));
stroke->on_popup_close = [this, tick](Node*) {
tick->destroy();
};
pp::panopainter::bind_legacy_popup_close_destroys_overlay(*stroke, tick);
};
}
//if (auto* button = layout[main_id]->find<NodeButtonCustom>("btn-brush"))
@@ -531,9 +529,7 @@ void App::init_sidebar()
color->SetPositioning(YGPositionTypeAbsolute);
pp::panopainter::activate_legacy_popup_overlay(*color);
color->on_popup_close = [this, tick](Node*) {
tick->destroy();
};
pp::panopainter::bind_legacy_popup_close_destroys_overlay(*color, tick);
};
}
if (auto* button = layout[main_id]->find<NodeButtonCustom>("btn-layer"))
@@ -566,9 +562,7 @@ void App::init_sidebar()
auto scroll = layers->find<NodeScroll>("layers-container");
scroll->SetMaxHeight(glm::max(100.f, screen.y - pos.y - 200.f));
layers->on_popup_close = [this, tick](Node*) {
tick->destroy();
};
pp::panopainter::bind_legacy_popup_close_destroys_overlay(*layers, tick);
};
}
if (auto* button = layout[main_id]->find<NodeButtonCustom>("btn-grids-panel"))
@@ -601,9 +595,7 @@ void App::init_sidebar()
auto scroll = grid->find<NodeScroll>("scroller");
scroll->SetMaxHeight(glm::max(100.f, screen.y - pos.y - 250.f));
grid->on_popup_close = [this, tick](Node*) {
tick->destroy();
};
pp::panopainter::bind_legacy_popup_close_destroys_overlay(*grid, tick);
};
}
}