Extract edit menu and Windows/bootstrap preview seams
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
namespace pp::panopainter {
|
||||
void bind_legacy_main_toolbar(App& app);
|
||||
void bind_legacy_file_menu(App& app);
|
||||
void bind_legacy_edit_menu(App& app);
|
||||
void bind_legacy_about_menu(App& app);
|
||||
void bind_legacy_layer_menu(App& app);
|
||||
void bind_legacy_tools_menu(App& app);
|
||||
@@ -54,25 +55,6 @@ bool apply_brush_preset_plan(App& app, const std::shared_ptr<Brush>& brush)
|
||||
return pp::panopainter::apply_legacy_brush_preset_plan(app, brush);
|
||||
}
|
||||
|
||||
std::shared_ptr<NodePopupMenu> add_menu_popup(
|
||||
App& app,
|
||||
const char* template_id,
|
||||
glm::vec2 position,
|
||||
float rtl_anchor_width)
|
||||
{
|
||||
const auto popup = pp::panopainter::add_legacy_popup_menu(
|
||||
app,
|
||||
template_id,
|
||||
position.x,
|
||||
position.y,
|
||||
rtl_anchor_width);
|
||||
if (!popup) {
|
||||
LOG("Popup menu '%s' failed: %s", template_id ? template_id : "<null>", popup.status().message);
|
||||
return nullptr;
|
||||
}
|
||||
return popup.value();
|
||||
}
|
||||
|
||||
[[nodiscard]] bool should_open_tools_panel(const pp::app::ToolsPanelPlan& plan) noexcept
|
||||
{
|
||||
return plan.action == pp::app::ToolsPanelAction::open_floating_panel;
|
||||
@@ -197,15 +179,7 @@ void App::init_menu_file()
|
||||
|
||||
void App::init_menu_edit()
|
||||
{
|
||||
if (auto* menu_file = layout[main_id]->find<NodeButtonCustom>("menu-edit"))
|
||||
{
|
||||
menu_file->on_click = [=](Node*) {
|
||||
glm::vec2 pos = menu_file->m_pos + glm::vec2(0, menu_file->m_size.y);
|
||||
auto popup = add_menu_popup(*this, "edit-menu", pos, menu_file->m_size.x);
|
||||
if (!popup)
|
||||
return;
|
||||
};
|
||||
}
|
||||
pp::panopainter::bind_legacy_edit_menu(*this);
|
||||
}
|
||||
|
||||
void App::init_menu_tools()
|
||||
|
||||
Reference in New Issue
Block a user