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

@@ -333,9 +333,7 @@ void NodePanelStroke::init_controls()
pp::panopainter::activate_legacy_popup_overlay(*App::I->presets);
root()->update();
App::I->presets->on_popup_close = [this, tick](Node*) {
tick->destroy();
};
pp::panopainter::bind_legacy_popup_close_destroys_overlay(*App::I->presets, tick);
App::I->presets->on_brush_changed = [this](Node* target, std::shared_ptr<Brush>& b) {
// don't change some params
@@ -378,9 +376,7 @@ void NodePanelStroke::init_controls()
pp::panopainter::activate_legacy_popup_overlay(*m_brush_popup);
root()->update();
m_brush_popup->on_popup_close = [this, tick](Node*) {
tick->destroy();
};
pp::panopainter::bind_legacy_popup_close_destroys_overlay(*m_brush_popup, tick);
m_brush_popup->on_brush_changed = [this](Node*, int index) {
if (on_brush_changed)
@@ -415,9 +411,7 @@ void NodePanelStroke::init_controls()
pp::panopainter::activate_legacy_popup_overlay(*m_brush_popup);
root()->update();
m_brush_popup->on_popup_close = [this, tick](Node*) {
tick->destroy();
};
pp::panopainter::bind_legacy_popup_close_destroys_overlay(*m_brush_popup, tick);
m_brush_popup->on_brush_changed = [this](Node*, int index) {
m_dual_enabled->set_value(true, true);
@@ -452,9 +446,7 @@ void NodePanelStroke::init_controls()
pp::panopainter::activate_legacy_popup_overlay(*m_pattern_popup);
root()->update();
m_pattern_popup->on_popup_close = [this, tick](Node*) {
tick->destroy();
};
pp::panopainter::bind_legacy_popup_close_destroys_overlay(*m_pattern_popup, tick);
m_pattern_popup->on_brush_changed = [this](Node*, int index) {
m_pattern_enabled->set_value(true, true);