From d0ff58141284f4b4092841345200c166cbf3856a Mon Sep 17 00:00:00 2001 From: scawful Date: Thu, 25 Sep 2025 10:57:47 -0400 Subject: [PATCH] Add PNG support handling in GraphicsEditor and include in file_dialog - Introduced conditional compilation for PNG clipboard operations in graphics_editor.cc, providing user feedback when PNG support is disabled. - Added header in file_dialog.cc to support string manipulation functions, enhancing functionality. --- src/app/core/platform/file_dialog.cc | 1 + src/app/editor/graphics/graphics_editor.cc | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/app/core/platform/file_dialog.cc b/src/app/core/platform/file_dialog.cc index 03eb42d2..00d160ce 100644 --- a/src/app/core/platform/file_dialog.cc +++ b/src/app/core/platform/file_dialog.cc @@ -11,6 +11,7 @@ #include #include +#include namespace yaze { namespace core { diff --git a/src/app/editor/graphics/graphics_editor.cc b/src/app/editor/graphics/graphics_editor.cc index d14c6c1a..f1f69d35 100644 --- a/src/app/editor/graphics/graphics_editor.cc +++ b/src/app/editor/graphics/graphics_editor.cc @@ -134,6 +134,7 @@ void GraphicsEditor::DrawGfxEditToolset() { TableNextColumn(); if (Button(ICON_MD_CONTENT_PASTE)) { +#if YAZE_LIB_PNG == 1 std::vector png_data; int width, height; core::GetImageFromClipboard(png_data, width, height); @@ -145,6 +146,10 @@ void GraphicsEditor::DrawGfxEditToolset() { Renderer::Get().UpdateBitmap( &gfx::Arena::Get().mutable_gfx_sheets()->at(current_sheet_)); } +#else + // PNG support disabled - show message or alternative action + status_ = absl::UnimplementedError("PNG import not available in this build"); +#endif } HOVER_HINT("Paste from Clipboard");