Extract app frame and ui state services
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "node_panel_floating.h"
|
||||
#include "app_core/brush_ui.h"
|
||||
#include "app_core/document_layer.h"
|
||||
#include "legacy_sidebar_color_popup_services.h"
|
||||
#include "legacy_brush_ui_services.h"
|
||||
#include "legacy_document_layer_services.h"
|
||||
#include "legacy_ui_overlay_services.h"
|
||||
@@ -297,37 +298,7 @@ void App::init_sidebar()
|
||||
if (!popup_root) {
|
||||
return;
|
||||
}
|
||||
glm::vec2 pos = button->m_pos + glm::vec2(button->m_size.x * 0.5f, button->m_size.y);
|
||||
const auto popup_overlay = pp::panopainter::open_legacy_overlay_node_with_handle(*popup_root, color);
|
||||
if (!popup_overlay)
|
||||
{
|
||||
LOG("Color popup overlay failed: %s", popup_overlay.status().message);
|
||||
return;
|
||||
}
|
||||
color->find("title")->SetVisibility(true);
|
||||
color->SetSize(350, 350);
|
||||
auto tick = pp::panopainter::make_legacy_overlay_node_for_anchor<NodeImage>(*layout[main_id]);
|
||||
tick->SetPositioning(YGPositionTypeAbsolute);
|
||||
tick->SetSize(32, 16);
|
||||
tick->SetPosition(pos.x - 16, pos.y);
|
||||
tick->set_image("data/ui/popup-tick-up.png");
|
||||
auto tick_overlay = pp::panopainter::open_legacy_overlay_node_with_handle(*popup_root, tick);
|
||||
if (!popup_overlay || !tick_overlay)
|
||||
{
|
||||
close_legacy_overlay_handles_if_open(*popup_root, popup_overlay, tick_overlay);
|
||||
return;
|
||||
}
|
||||
const auto popup_handle = popup_overlay.value();
|
||||
const auto tick_handle = tick_overlay.value();
|
||||
popup_root->update();
|
||||
|
||||
color->SetPosition(pos.x - color->m_size.x / 2.f, pos.y + 16);
|
||||
color->SetPositioning(YGPositionTypeAbsolute);
|
||||
pp::panopainter::activate_legacy_popup_overlay(*color);
|
||||
color->on_popup_close = [popup_root, popup_handle, tick_handle](Node*) {
|
||||
close_legacy_overlay_handle_ignoring_status(*popup_root, popup_handle);
|
||||
close_legacy_overlay_handle_ignoring_status(*popup_root, tick_handle);
|
||||
};
|
||||
pp::panopainter::open_legacy_sidebar_color_popup(*this, *popup_root, *button, *color);
|
||||
};
|
||||
}
|
||||
if (auto* button = layout[main_id]->find<NodeButtonCustom>("btn-layer"))
|
||||
|
||||
Reference in New Issue
Block a user