Modal dialog management for canvas operations. More...
#include <canvas_modals.h>
Classes | |
struct | ModalState |
Public Member Functions | |
CanvasModals ()=default | |
void | ShowAdvancedProperties (const std::string &canvas_id, const CanvasConfig &config, const gfx::Bitmap *bitmap=nullptr) |
Show advanced canvas properties modal. | |
void | ShowScalingControls (const std::string &canvas_id, const CanvasConfig &config, const gfx::Bitmap *bitmap=nullptr) |
Show scaling controls modal. | |
void | ShowBppConversionDialog (const std::string &canvas_id, const BppConversionOptions &options) |
Show BPP format conversion dialog. | |
void | ShowPaletteEditor (const std::string &canvas_id, const PaletteEditorOptions &options) |
Show palette editor modal. | |
void | ShowColorAnalysis (const std::string &canvas_id, const ColorAnalysisOptions &options) |
Show color analysis modal. | |
void | ShowPerformanceIntegration (const std::string &canvas_id, const PerformanceOptions &options) |
Show performance dashboard integration. | |
void | Render () |
Render all active modals. | |
bool | IsAnyModalOpen () const |
Check if any modal is open. | |
Private Member Functions | |
void | RenderAdvancedPropertiesModal (const std::string &canvas_id, CanvasConfig &config, const gfx::Bitmap *bitmap) |
void | RenderScalingControlsModal (const std::string &canvas_id, CanvasConfig &config, const gfx::Bitmap *bitmap) |
void | RenderBppConversionModal (const std::string &canvas_id, const BppConversionOptions &options) |
void | RenderPaletteEditorModal (const std::string &canvas_id, const PaletteEditorOptions &options) |
void | RenderColorAnalysisModal (const std::string &canvas_id, const ColorAnalysisOptions &options) |
void | RenderPerformanceModal (const std::string &canvas_id, const PerformanceOptions &options) |
void | OpenModal (const std::string &id, std::function< void()> render_func) |
void | CloseModal (const std::string &id) |
bool | IsModalOpen (const std::string &id) const |
void | RenderMaterialIcon (const std::string &icon_name, const ImVec4 &color=ImVec4(1, 1, 1, 1)) |
void | RenderMetricCard (const std::string &title, const std::string &value, const std::string &icon, const ImVec4 &color=ImVec4(1, 1, 1, 1)) |
void | RenderSliderWithIcon (const std::string &label, const std::string &icon, float *value, float min_val, float max_val, const char *format="%.2f") |
Private Attributes | |
std::vector< ModalState > | active_modals_ |
Modal dialog management for canvas operations.
Definition at line 82 of file canvas_modals.h.
|
default |
void yaze::gui::canvas::CanvasModals::ShowAdvancedProperties | ( | const std::string & | canvas_id, |
const CanvasConfig & | config, | ||
const gfx::Bitmap * | bitmap = nullptr |
||
) |
Show advanced canvas properties modal.
Definition at line 34 of file canvas_modals.cc.
References yaze::gui::canvas::CanvasConfig::on_config_changed, yaze::gui::canvas::CanvasConfig::on_scale_changed, OpenModal(), and RenderAdvancedPropertiesModal().
void yaze::gui::canvas::CanvasModals::ShowScalingControls | ( | const std::string & | canvas_id, |
const CanvasConfig & | config, | ||
const gfx::Bitmap * | bitmap = nullptr |
||
) |
Show scaling controls modal.
Definition at line 50 of file canvas_modals.cc.
References yaze::gui::canvas::CanvasConfig::on_config_changed, yaze::gui::canvas::CanvasConfig::on_scale_changed, OpenModal(), and RenderScalingControlsModal().
void yaze::gui::canvas::CanvasModals::ShowBppConversionDialog | ( | const std::string & | canvas_id, |
const BppConversionOptions & | options | ||
) |
Show BPP format conversion dialog.
Definition at line 66 of file canvas_modals.cc.
References OpenModal(), and RenderBppConversionModal().
void yaze::gui::canvas::CanvasModals::ShowPaletteEditor | ( | const std::string & | canvas_id, |
const PaletteEditorOptions & | options | ||
) |
Show palette editor modal.
Definition at line 78 of file canvas_modals.cc.
References OpenModal(), and RenderPaletteEditorModal().
void yaze::gui::canvas::CanvasModals::ShowColorAnalysis | ( | const std::string & | canvas_id, |
const ColorAnalysisOptions & | options | ||
) |
Show color analysis modal.
Definition at line 90 of file canvas_modals.cc.
References OpenModal(), and RenderColorAnalysisModal().
void yaze::gui::canvas::CanvasModals::ShowPerformanceIntegration | ( | const std::string & | canvas_id, |
const PerformanceOptions & | options | ||
) |
Show performance dashboard integration.
Definition at line 102 of file canvas_modals.cc.
References OpenModal(), and RenderPerformanceModal().
void yaze::gui::canvas::CanvasModals::Render | ( | ) |
Render all active modals.
Definition at line 114 of file canvas_modals.cc.
References active_modals_.
bool yaze::gui::canvas::CanvasModals::IsAnyModalOpen | ( | ) | const |
Check if any modal is open.
Definition at line 128 of file canvas_modals.cc.
References active_modals_.
|
private |
Definition at line 133 of file canvas_modals.cc.
References yaze::gui::canvas::CanvasConfig::auto_resize, yaze::gui::canvas::CanvasConfig::canvas_size, yaze::gui::canvas::CanvasConfig::content_size, yaze::gui::canvas::DispatchConfigCallback(), yaze::gui::canvas::CanvasConfig::enable_context_menu, yaze::gui::canvas::CanvasConfig::enable_custom_labels, yaze::gui::canvas::CanvasConfig::enable_grid, yaze::gui::canvas::CanvasConfig::enable_hex_labels, yaze::gfx::PerformanceDashboard::Get(), yaze::gfx::PerformanceProfiler::Get(), yaze::gui::canvas::CanvasConfig::global_scale, yaze::gui::canvas::CanvasConfig::grid_step, yaze::gfx::Bitmap::height(), ICON_MD_ANALYTICS, ICON_MD_BUILD, ICON_MD_GRID_ON, ICON_MD_IMAGE, ICON_MD_SETTINGS, ICON_MD_STRAIGHTEN, ICON_MD_TRENDING_UP, ICON_MD_ZOOM_IN, yaze::gui::canvas::CanvasConfig::is_draggable, yaze::gui::canvas::CanvasConfig::on_config_changed, RenderMaterialIcon(), RenderMetricCard(), RenderSliderWithIcon(), yaze::gui::canvas::CanvasConfig::scrolling, yaze::gfx::PerformanceDashboard::SetVisible(), and yaze::gfx::Bitmap::width().
Referenced by ShowAdvancedProperties().
|
private |
Definition at line 292 of file canvas_modals.cc.
References yaze::gui::canvas::CanvasConfig::canvas_size, yaze::gui::canvas::DispatchScaleCallback(), yaze::gui::canvas::CanvasConfig::global_scale, yaze::gui::canvas::CanvasConfig::grid_step, yaze::gfx::Bitmap::height(), ICON_MD_ZOOM_IN, yaze::gui::canvas::CanvasConfig::on_scale_changed, RenderSliderWithIcon(), and yaze::gfx::Bitmap::width().
Referenced by ShowScalingControls().
|
private |
Definition at line 376 of file canvas_modals.cc.
References yaze::gui::canvas::BppConversionOptions::bitmap, ICON_MD_SWAP_HORIZ, yaze::gui::canvas::BppConversionOptions::on_convert, and yaze::gui::canvas::BppConversionOptions::palette.
Referenced by ShowBppConversionDialog().
|
private |
Definition at line 411 of file canvas_modals.cc.
References ICON_MD_PALETTE, yaze::gui::canvas::PaletteEditorOptions::palette, and yaze::gui::canvas::PaletteEditorOptions::title.
Referenced by ShowPaletteEditor().
|
private |
Definition at line 444 of file canvas_modals.cc.
References yaze::gui::canvas::ColorAnalysisOptions::bitmap, and ICON_MD_ZOOM_IN.
Referenced by ShowColorAnalysis().
|
private |
Definition at line 477 of file canvas_modals.cc.
References yaze::gfx::PerformanceDashboard::Get(), yaze::gfx::PerformanceProfiler::Get(), ICON_MD_TRENDING_UP, yaze::gui::canvas::PerformanceOptions::operation_name, yaze::gui::canvas::PerformanceOptions::operation_time_ms, RenderMetricCard(), and yaze::gfx::PerformanceDashboard::SetVisible().
Referenced by ShowPerformanceIntegration().
|
private |
Definition at line 519 of file canvas_modals.cc.
References active_modals_.
Referenced by ShowAdvancedProperties(), ShowBppConversionDialog(), ShowColorAnalysis(), ShowPaletteEditor(), ShowPerformanceIntegration(), and ShowScalingControls().
|
private |
Definition at line 535 of file canvas_modals.cc.
References active_modals_.
|
private |
Definition at line 544 of file canvas_modals.cc.
References active_modals_.
|
private |
Definition at line 551 of file canvas_modals.cc.
References ICON_MD_DRAG_INDICATOR, ICON_MD_EDIT, ICON_MD_FIT_SCREEN, ICON_MD_FUNCTIONS, ICON_MD_GRID_ON, ICON_MD_INFO, ICON_MD_LABEL, ICON_MD_MENU, ICON_MD_REFRESH, ICON_MD_SCHEDULE, ICON_MD_SETTINGS, ICON_MD_SPEED, ICON_MD_TIMER, and ICON_MD_ZOOM_IN.
Referenced by RenderAdvancedPropertiesModal().
|
private |
Definition at line 567 of file canvas_modals.cc.
Referenced by RenderAdvancedPropertiesModal(), and RenderPerformanceModal().
|
private |
Definition at line 580 of file canvas_modals.cc.
Referenced by RenderAdvancedPropertiesModal(), and RenderScalingControlsModal().
|
private |
Definition at line 141 of file canvas_modals.h.
Referenced by CloseModal(), IsAnyModalOpen(), IsModalOpen(), OpenModal(), and Render().