Centralize retained panel popup attachment
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "pch.h"
|
||||
#include "app_core/brush_ui.h"
|
||||
#include "legacy_brush_ui_services.h"
|
||||
#include "legacy_ui_overlay_services.h"
|
||||
#include "log.h"
|
||||
#include "node_panel_stroke.h"
|
||||
#include "canvas.h"
|
||||
@@ -316,7 +317,7 @@ void NodePanelStroke::init_controls()
|
||||
m_preset_button->on_click = [this](Node*) {
|
||||
auto screen = root()->m_size;
|
||||
glm::vec2 pos = m_preset_button->m_pos + glm::vec2(m_preset_button->m_size.x, 0);
|
||||
root()->add_child(App::I->presets);
|
||||
(void)pp::panopainter::attach_legacy_overlay_node_to_root(*this, App::I->presets);
|
||||
auto tick = root()->add_child<NodeImage>();
|
||||
tick->SetPositioning(YGPositionTypeAbsolute);
|
||||
tick->SetSize(16, 32);
|
||||
@@ -367,7 +368,7 @@ void NodePanelStroke::init_controls()
|
||||
m_brush_button->on_click = [this](Node*) {
|
||||
auto screen = root()->m_size;
|
||||
glm::vec2 pos = m_brush_button->m_pos + glm::vec2(m_brush_button->m_size.x, 0);
|
||||
root()->add_child(m_brush_popup);
|
||||
(void)pp::panopainter::attach_legacy_overlay_node_to_root(*this, m_brush_popup);
|
||||
auto tick = root()->add_child<NodeImage>();
|
||||
tick->SetPositioning(YGPositionTypeAbsolute);
|
||||
tick->SetSize(16, 32);
|
||||
@@ -403,7 +404,7 @@ void NodePanelStroke::init_controls()
|
||||
m_dual_brush_button->on_click = [this](Node*) {
|
||||
auto screen = root()->m_size;
|
||||
glm::vec2 pos = m_dual_brush_button->m_pos + glm::vec2(m_dual_brush_button->m_size.x, 0);
|
||||
root()->add_child(m_brush_popup);
|
||||
(void)pp::panopainter::attach_legacy_overlay_node_to_root(*this, m_brush_popup);
|
||||
auto tick = root()->add_child<NodeImage>();
|
||||
tick->SetPositioning(YGPositionTypeAbsolute);
|
||||
tick->SetSize(16, 32);
|
||||
@@ -439,7 +440,7 @@ void NodePanelStroke::init_controls()
|
||||
m_pattern_button->on_click = [this](Node*) {
|
||||
auto screen = root()->m_size;
|
||||
glm::vec2 pos = m_pattern_button->m_pos + glm::vec2(m_pattern_button->m_size.x, 0);
|
||||
root()->add_child(m_pattern_popup);
|
||||
(void)pp::panopainter::attach_legacy_overlay_node_to_root(*this, m_pattern_popup);
|
||||
auto tick = root()->add_child<NodeImage>();
|
||||
tick->SetPositioning(YGPositionTypeAbsolute);
|
||||
tick->SetSize(16, 32);
|
||||
|
||||
Reference in New Issue
Block a user