Centralize retained popup tick overlays

This commit is contained in:
2026-06-12 14:45:04 +02:00
parent 7be588d763
commit 2e98efa13a
7 changed files with 51 additions and 20 deletions

View File

@@ -318,11 +318,12 @@ void NodePanelStroke::init_controls()
auto screen = root()->m_size;
glm::vec2 pos = m_preset_button->m_pos + glm::vec2(m_preset_button->m_size.x, 0);
(void)pp::panopainter::attach_legacy_overlay_node_to_root(*this, App::I->presets);
auto tick = root()->add_child<NodeImage>();
auto tick = pp::panopainter::make_legacy_overlay_node_for_anchor<NodeImage>(*this);
tick->SetPositioning(YGPositionTypeAbsolute);
tick->SetSize(16, 32);
tick->SetPosition(pos.x, pos.y + (m_preset_button->m_size.y - 32) * 0.5f);
tick->set_image("data/ui/popup-tick.png");
(void)pp::panopainter::attach_legacy_overlay_node_to_root(*this, tick);
float hh = App::I->presets->m_container->m_children.size() > 10 ? App::I->height / App::I->zoom * .75f : 400.f;
App::I->presets->SetHeight(glm::max(hh, 400.f));
App::I->presets->SetWidth(300);
@@ -369,11 +370,12 @@ void NodePanelStroke::init_controls()
auto screen = root()->m_size;
glm::vec2 pos = m_brush_button->m_pos + glm::vec2(m_brush_button->m_size.x, 0);
(void)pp::panopainter::attach_legacy_overlay_node_to_root(*this, m_brush_popup);
auto tick = root()->add_child<NodeImage>();
auto tick = pp::panopainter::make_legacy_overlay_node_for_anchor<NodeImage>(*this);
tick->SetPositioning(YGPositionTypeAbsolute);
tick->SetSize(16, 32);
tick->SetPosition(pos.x, pos.y + (m_brush_button->m_size.y - 32) * 0.5f);
tick->set_image("data/ui/popup-tick.png");
(void)pp::panopainter::attach_legacy_overlay_node_to_root(*this, tick);
root()->update();
if ((pos.y + m_brush_popup->m_size.y) > screen.y)
pos.y = screen.y - m_brush_popup->m_size.y;
@@ -405,11 +407,12 @@ void NodePanelStroke::init_controls()
auto screen = root()->m_size;
glm::vec2 pos = m_dual_brush_button->m_pos + glm::vec2(m_dual_brush_button->m_size.x, 0);
(void)pp::panopainter::attach_legacy_overlay_node_to_root(*this, m_brush_popup);
auto tick = root()->add_child<NodeImage>();
auto tick = pp::panopainter::make_legacy_overlay_node_for_anchor<NodeImage>(*this);
tick->SetPositioning(YGPositionTypeAbsolute);
tick->SetSize(16, 32);
tick->SetPosition(pos.x, pos.y + (m_dual_brush_button->m_size.y - 32) * 0.5f);
tick->set_image("data/ui/popup-tick.png");
(void)pp::panopainter::attach_legacy_overlay_node_to_root(*this, tick);
root()->update();
if ((pos.y + m_brush_popup->m_size.y) > screen.y)
pos.y = screen.y - m_brush_popup->m_size.y;
@@ -441,11 +444,12 @@ void NodePanelStroke::init_controls()
auto screen = root()->m_size;
glm::vec2 pos = m_pattern_button->m_pos + glm::vec2(m_pattern_button->m_size.x, 0);
(void)pp::panopainter::attach_legacy_overlay_node_to_root(*this, m_pattern_popup);
auto tick = root()->add_child<NodeImage>();
auto tick = pp::panopainter::make_legacy_overlay_node_for_anchor<NodeImage>(*this);
tick->SetPositioning(YGPositionTypeAbsolute);
tick->SetSize(16, 32);
tick->SetPosition(pos.x, pos.y + (m_pattern_button->m_size.y - 32) * 0.5f);
tick->set_image("data/ui/popup-tick.png");
(void)pp::panopainter::attach_legacy_overlay_node_to_root(*this, tick);
root()->update();
if ((pos.y + m_pattern_popup->m_size.y) > screen.y)
pos.y = screen.y - m_pattern_popup->m_size.y;