Main window for the WYSIWYG layout designer. More...
#include <layout_designer_window.h>
Classes | |
| struct | PalettePanel |
Public Member Functions | |
| LayoutDesignerWindow ()=default | |
| LayoutDesignerWindow (yaze::editor::LayoutManager *layout_manager, PanelManager *panel_manager, yaze::editor::EditorManager *editor_manager) | |
| void | Initialize (PanelManager *panel_manager, yaze::editor::LayoutManager *layout_manager=nullptr, yaze::editor::EditorManager *editor_manager=nullptr) |
| Initialize the designer with manager references. | |
| void | Open () |
| Open the designer window. | |
| void | Close () |
| Close the designer window. | |
| bool | IsOpen () const |
| Check if designer window is open. | |
| void | Draw () |
| Draw the designer window (call every frame) | |
| void | NewLayout () |
| Create a new empty layout. | |
| void | LoadLayout (const std::string &filepath) |
| Load a layout from JSON file. | |
| void | SaveLayout (const std::string &filepath) |
| Save current layout to JSON file. | |
| void | ImportFromRuntime () |
| Import layout from current runtime state. | |
| void | ImportPanelDesign (const std::string &panel_id) |
| Import a specific panel's design from runtime. | |
| void | ExportCode (const std::string &filepath) |
| Export layout as C++ code. | |
| void | PreviewLayout () |
| Apply current layout to the application (live preview) | |
Private Member Functions | |
| void | DrawMenuBar () |
| void | DrawToolbar () |
| void | DrawPalette () |
| void | DrawCanvas () |
| void | DrawProperties () |
| void | DrawTreeView () |
| void | DrawCodePreview () |
| void | DrawWidgetPalette () |
| void | DrawWidgetCanvas () |
| void | DrawWidgetProperties () |
| void | DrawWidgetTree () |
| void | DrawWidgetCodePreview () |
| void | DrawThemeProperties () |
| void | HandleCanvasDragDrop () |
| void | DrawDockNode (DockNode *node, const ImVec2 &pos, const ImVec2 &size) |
| void | DrawDropZones (const ImVec2 &pos, const ImVec2 &size, DockNode *target_node) |
| bool | IsMouseOverRect (const ImVec2 &rect_min, const ImVec2 &rect_max) const |
| ImGuiDir | GetDropZone (const ImVec2 &mouse_pos, const ImVec2 &rect_min, const ImVec2 &rect_max) const |
| void | ResetDropState () |
| std::optional< PalettePanel > | ResolvePanelById (const std::string &panel_id) const |
| void | AddPanelToTarget (const PalettePanel &panel) |
| void | DrawPanelProperties (LayoutPanel *panel) |
| void | DrawNodeProperties (DockNode *node) |
| std::string | GenerateDockBuilderCode () const |
| std::string | GenerateLayoutPresetCode () const |
| void | DrawDockNodeTree (DockNode *node, int &node_index) |
| void | DeleteNode (DockNode *node) |
| void | DeletePanel (LayoutPanel *panel) |
| void | PushUndoState () |
| void | Undo () |
| void | Redo () |
| std::vector< PalettePanel > | GetAvailablePanels () const |
| void | RefreshPanelCache () |
| bool | MatchesSearchFilter (const PalettePanel &panel) const |
Static Private Attributes | |
| static constexpr size_t | kMaxUndoSteps = 50 |
Main window for the WYSIWYG layout designer.
Provides a visual interface for designing ImGui panel layouts:
Definition at line 43 of file layout_designer_window.h.
|
default |
|
inlineexplicit |
Definition at line 46 of file layout_designer_window.h.
| void yaze::editor::layout_designer::LayoutDesignerWindow::Initialize | ( | PanelManager * | panel_manager, |
| yaze::editor::LayoutManager * | layout_manager = nullptr, | ||
| yaze::editor::EditorManager * | editor_manager = nullptr ) |
Initialize the designer with manager references.
| panel_manager | Reference to PanelManager for importing panels |
Definition at line 154 of file layout_designer_window.cc.
References editor_manager_, layout_manager_, LOG_INFO, and panel_manager_.
Referenced by yaze::editor::EditorManager::Initialize().
| void yaze::editor::layout_designer::LayoutDesignerWindow::Open | ( | ) |
Open the designer window.
Definition at line 163 of file layout_designer_window.cc.
References current_layout_, is_open_, and NewLayout().
Referenced by yaze::editor::EditorManager::OpenLayoutDesigner().

| void yaze::editor::layout_designer::LayoutDesignerWindow::Close | ( | ) |
Close the designer window.
Definition at line 170 of file layout_designer_window.cc.
References is_open_.
Referenced by DrawMenuBar().
|
inline |
Check if designer window is open.
Definition at line 72 of file layout_designer_window.h.
References is_open_.
Referenced by yaze::editor::EditorManager::Update().
| void yaze::editor::layout_designer::LayoutDesignerWindow::Draw | ( | ) |
Draw the designer window (call every frame)
Definition at line 174 of file layout_designer_window.cc.
References design_mode_, DrawCanvas(), DrawCodePreview(), DrawMenuBar(), DrawPalette(), DrawProperties(), DrawThemeProperties(), DrawToolbar(), DrawWidgetCanvas(), DrawWidgetPalette(), DrawWidgetProperties(), ICON_MD_DASHBOARD, is_open_, yaze::editor::layout_designer::PanelLayout, show_code_preview_, and show_theme_panel_.
Referenced by yaze::editor::EditorManager::Update().
| void yaze::editor::layout_designer::LayoutDesignerWindow::NewLayout | ( | ) |
Create a new empty layout.
Definition at line 1403 of file layout_designer_window.cc.
References LOG_INFO.
Referenced by DrawCanvas(), DrawMenuBar(), DrawToolbar(), and Open().
| void yaze::editor::layout_designer::LayoutDesignerWindow::LoadLayout | ( | const std::string & | filepath | ) |
Load a layout from JSON file.
Definition at line 1411 of file layout_designer_window.cc.
| void yaze::editor::layout_designer::LayoutDesignerWindow::SaveLayout | ( | const std::string & | filepath | ) |
Save current layout to JSON file.
Definition at line 1427 of file layout_designer_window.cc.
| void yaze::editor::layout_designer::LayoutDesignerWindow::ImportFromRuntime | ( | ) |
Import layout from current runtime state.
Definition at line 1444 of file layout_designer_window.cc.
References yaze::editor::layout_designer::LayoutPanel::closable, yaze::editor::layout_designer::LayoutPanel::display_name, yaze::editor::layout_designer::LayoutPanel::icon, LOG_ERROR, LOG_INFO, yaze::editor::layout_designer::LayoutPanel::panel_id, yaze::editor::layout_designer::LayoutPanel::pinnable, yaze::editor::layout_designer::LayoutPanel::priority, and yaze::editor::layout_designer::LayoutPanel::visible_by_default.
Referenced by DrawMenuBar().
| void yaze::editor::layout_designer::LayoutDesignerWindow::ImportPanelDesign | ( | const std::string & | panel_id | ) |
Import a specific panel's design from runtime.
| panel_id | The panel ID to import |
Definition at line 1479 of file layout_designer_window.cc.
References LOG_ERROR, and LOG_INFO.
Referenced by DrawMenuBar().
| void yaze::editor::layout_designer::LayoutDesignerWindow::ExportCode | ( | const std::string & | filepath | ) |
Export layout as C++ code.
Definition at line 1508 of file layout_designer_window.cc.
References LOG_INFO.
| void yaze::editor::layout_designer::LayoutDesignerWindow::PreviewLayout | ( | ) |
Apply current layout to the application (live preview)
Definition at line 1513 of file layout_designer_window.cc.
References LOG_INFO, and LOG_WARN.
Referenced by DrawMenuBar(), and DrawToolbar().
|
private |
Definition at line 239 of file layout_designer_window.cc.
References canvas_zoom_, Close(), current_layout_, yaze::editor::PanelManager::GetAllPanelDescriptors(), ICON_MD_CHECK, ICON_MD_CLOSE, ICON_MD_DELETE, ICON_MD_DOWNLOAD, ICON_MD_FOLDER_OPEN, ICON_MD_HELP, ICON_MD_INFO, ICON_MD_NOTE_ADD, ICON_MD_PLAY_ARROW, ICON_MD_REDO, ICON_MD_SAVE, ICON_MD_SAVE_AS, ICON_MD_UNDO, ICON_MD_UPLOAD, ICON_MD_WIDGETS, ICON_MD_ZOOM_IN, ICON_MD_ZOOM_OUT, ICON_MD_ZOOM_OUT_MAP, ImportFromRuntime(), ImportPanelDesign(), LOG_ERROR, LOG_INFO, NewLayout(), panel_manager_, PreviewLayout(), selected_panel_, show_code_preview_, show_theme_panel_, and show_tree_view_.
Referenced by Draw().
|
private |
Definition at line 351 of file layout_designer_window.cc.
References current_layout_, current_panel_design_, design_mode_, ICON_MD_CODE, ICON_MD_DASHBOARD, ICON_MD_FOLDER_OPEN, ICON_MD_NOTE_ADD, ICON_MD_PLAY_ARROW, ICON_MD_RESET_TV, ICON_MD_SAVE, ICON_MD_WIDGETS, LOG_INFO, LOG_WARN, NewLayout(), yaze::editor::layout_designer::PanelLayout, PreviewLayout(), show_code_preview_, and yaze::editor::layout_designer::WidgetDesign.
Referenced by Draw().

|
private |
Definition at line 434 of file layout_designer_window.cc.
References dragging_panel_, GetAvailablePanels(), ICON_MD_SEARCH, ICON_MD_WIDGETS, is_dragging_panel_, LOG_INFO, MatchesSearchFilter(), search_filter_, and selected_category_filter_.
Referenced by Draw().

|
private |
Definition at line 559 of file layout_designer_window.cc.
References AddPanelToTarget(), canvas_zoom_, current_layout_, DrawDockNode(), ICON_MD_DASHBOARD, ICON_MD_DRAG_INDICATOR, ICON_MD_ZOOM_IN, ICON_MD_ZOOM_OUT, is_dragging_panel_, LOG_WARN, NewLayout(), ResetDropState(), and ResolvePanelById().
Referenced by Draw().
|
private |
Definition at line 803 of file layout_designer_window.cc.
References current_layout_, DrawNodeProperties(), DrawPanelProperties(), DrawTreeView(), ICON_MD_TUNE, selected_node_, selected_panel_, and show_tree_view_.
Referenced by Draw().

|
private |
Definition at line 882 of file layout_designer_window.cc.
References current_layout_, DrawDockNodeTree(), and ICON_MD_ACCOUNT_TREE.
Referenced by DrawProperties().

|
private |
Definition at line 894 of file layout_designer_window.cc.
References current_panel_design_, design_mode_, DrawWidgetCodePreview(), GenerateDockBuilderCode(), GenerateLayoutPresetCode(), yaze::editor::layout_designer::WidgetCodeGenerator::GenerateMemberVariables(), ICON_MD_CODE, yaze::editor::layout_designer::PanelLayout, and show_code_preview_.
Referenced by Draw().

|
private |
Definition at line 1778 of file layout_designer_window.cc.
References yaze::editor::layout_designer::GetWidgetTypeIcon(), yaze::editor::layout_designer::GetWidgetTypeName(), ICON_MD_SEARCH, ICON_MD_WIDGETS, and LOG_INFO.
Referenced by Draw().

|
private |
Definition at line 1902 of file layout_designer_window.cc.
References yaze::editor::layout_designer::GetDefaultProperties(), yaze::editor::layout_designer::GetWidgetTypeIcon(), yaze::editor::layout_designer::GetWidgetTypeName(), ICON_MD_DRAW, and LOG_INFO.
Referenced by Draw().

|
private |
Definition at line 2010 of file layout_designer_window.cc.
References yaze::editor::layout_designer::GetWidgetTypeName(), ICON_MD_TUNE, and LOG_INFO.
Referenced by Draw().

|
private |
Definition at line 2100 of file layout_designer_window.cc.
References yaze::editor::layout_designer::GetWidgetTypeIcon(), and ICON_MD_ACCOUNT_TREE.

|
private |
Definition at line 2120 of file layout_designer_window.cc.
Referenced by DrawCodePreview().
|
private |
Definition at line 2131 of file layout_designer_window.cc.
References ICON_MD_PALETTE.
Referenced by Draw().
|
private |
|
private |
Definition at line 652 of file layout_designer_window.cc.
References yaze::editor::layout_designer::DockNode::child_left, yaze::editor::layout_designer::DockNode::child_right, DrawDockNode(), DrawDropZones(), yaze::editor::layout_designer::DockNode::flags, yaze::editor::layout_designer::DockNode::IsLeaf(), IsMouseOverRect(), yaze::editor::layout_designer::DockNode::IsSplit(), LOG_INFO, yaze::editor::layout_designer::DockNode::panels, selected_node_, selected_panel_, yaze::editor::layout_designer::DockNode::split_dir, and yaze::editor::layout_designer::DockNode::split_ratio.
Referenced by DrawCanvas(), and DrawDockNode().
|
private |
Definition at line 1541 of file layout_designer_window.cc.
References LOG_INFO, and LOG_WARN.
Referenced by DrawDockNode().
|
private |
Definition at line 1642 of file layout_designer_window.cc.
Referenced by DrawDockNode().
|
private |
Definition at line 1649 of file layout_designer_window.cc.
|
private |
Definition at line 1679 of file layout_designer_window.cc.
Referenced by DrawCanvas().
|
private |
Definition at line 1685 of file layout_designer_window.cc.
References yaze::editor::layout_designer::LayoutDesignerWindow::PalettePanel::category, yaze::editor::layout_designer::LayoutDesignerWindow::PalettePanel::icon, yaze::editor::layout_designer::LayoutDesignerWindow::PalettePanel::id, yaze::editor::layout_designer::LayoutDesignerWindow::PalettePanel::name, and yaze::editor::layout_designer::LayoutDesignerWindow::PalettePanel::priority.
Referenced by DrawCanvas().
|
private |
Definition at line 1715 of file layout_designer_window.cc.
References yaze::editor::layout_designer::DockNode::AddPanel(), yaze::editor::layout_designer::DockNode::child_left, yaze::editor::layout_designer::DockNode::child_right, yaze::editor::layout_designer::LayoutPanel::closable, yaze::editor::layout_designer::LayoutPanel::display_name, yaze::editor::layout_designer::LayoutPanel::icon, yaze::editor::layout_designer::LayoutDesignerWindow::PalettePanel::icon, yaze::editor::layout_designer::LayoutDesignerWindow::PalettePanel::id, yaze::editor::layout_designer::DockNode::IsLeaf(), LOG_INFO, LOG_WARN, yaze::editor::layout_designer::LayoutDesignerWindow::PalettePanel::name, yaze::editor::layout_designer::LayoutPanel::panel_id, yaze::editor::layout_designer::DockNode::panels, yaze::editor::layout_designer::LayoutPanel::pinnable, yaze::editor::layout_designer::LayoutPanel::priority, yaze::editor::layout_designer::LayoutDesignerWindow::PalettePanel::priority, yaze::editor::layout_designer::DockNode::Split(), and yaze::editor::layout_designer::LayoutPanel::visible_by_default.
Referenced by DrawCanvas().

|
private |
Definition at line 827 of file layout_designer_window.cc.
References yaze::editor::layout_designer::LayoutPanel::closable, yaze::editor::layout_designer::LayoutPanel::display_name, yaze::editor::layout_designer::LayoutPanel::flags, yaze::editor::layout_designer::LayoutPanel::headless, yaze::editor::layout_designer::LayoutPanel::minimizable, yaze::editor::layout_designer::LayoutPanel::pinnable, yaze::editor::layout_designer::LayoutPanel::priority, and yaze::editor::layout_designer::LayoutPanel::visible_by_default.
Referenced by DrawProperties().
|
private |
Definition at line 853 of file layout_designer_window.cc.
References yaze::editor::layout_designer::DockNode::flags, yaze::editor::layout_designer::DockNode::IsSplit(), yaze::editor::layout_designer::DockNode::panels, yaze::editor::layout_designer::DockNode::split_dir, and yaze::editor::layout_designer::DockNode::split_ratio.
Referenced by DrawProperties().

|
private |
Definition at line 940 of file layout_designer_window.cc.
References yaze::editor::layout_designer::DockNode::child_left, yaze::editor::layout_designer::DockNode::child_right, current_layout_, yaze::editor::layout_designer::DockNode::flags, yaze::editor::layout_designer::DockNode::IsLeaf(), yaze::editor::layout_designer::DockNode::panels, yaze::editor::layout_designer::DockNode::split_dir, and yaze::editor::layout_designer::DockNode::split_ratio.
Referenced by DrawCodePreview().

|
private |
Definition at line 1048 of file layout_designer_window.cc.
References current_layout_.
Referenced by DrawCodePreview().
|
private |
Definition at line 1092 of file layout_designer_window.cc.
References yaze::editor::layout_designer::DockNode::child_left, yaze::editor::layout_designer::DockNode::child_right, DeleteNode(), DeletePanel(), DrawDockNodeTree(), yaze::editor::layout_designer::DockNode::IsRoot(), yaze::editor::layout_designer::DockNode::IsSplit(), yaze::editor::layout_designer::DockNode::panels, selected_node_, selected_panel_, yaze::editor::layout_designer::DockNode::split_dir, and yaze::editor::layout_designer::DockNode::split_ratio.
Referenced by DrawDockNodeTree(), and DrawTreeView().
|
private |
Definition at line 1172 of file layout_designer_window.cc.
References yaze::editor::layout_designer::DockNode::child_left, yaze::editor::layout_designer::DockNode::child_right, current_layout_, yaze::editor::layout_designer::DockNode::flags, LOG_WARN, yaze::editor::layout_designer::DockNode::panels, PushUndoState(), selected_node_, selected_panel_, yaze::editor::layout_designer::DockNode::split_dir, yaze::editor::layout_designer::DockNode::split_ratio, and yaze::editor::layout_designer::DockNode::type.
Referenced by DrawDockNodeTree().

|
private |
Definition at line 1231 of file layout_designer_window.cc.
References current_layout_, PushUndoState(), and selected_panel_.
Referenced by DrawDockNodeTree().

|
private |
Definition at line 1259 of file layout_designer_window.cc.
References current_layout_, kMaxUndoSteps, redo_stack_, and undo_stack_.
Referenced by DeleteNode(), and DeletePanel().
|
private |
Definition at line 1271 of file layout_designer_window.cc.
References current_layout_, redo_stack_, selected_node_, selected_panel_, and undo_stack_.
|
private |
Definition at line 1286 of file layout_designer_window.cc.
References current_layout_, redo_stack_, selected_node_, selected_panel_, and undo_stack_.
|
private |
Definition at line 1302 of file layout_designer_window.cc.
References yaze::editor::layout_designer::LayoutDesignerWindow::PalettePanel::category, yaze::editor::layout_designer::LayoutDesignerWindow::PalettePanel::description, yaze::editor::PanelManager::GetAllPanelDescriptors(), yaze::editor::layout_designer::LayoutDesignerWindow::PalettePanel::icon, yaze::editor::layout_designer::LayoutDesignerWindow::PalettePanel::id, yaze::editor::layout_designer::LayoutDesignerWindow::PalettePanel::name, panel_cache_, panel_cache_dirty_, panel_manager_, and yaze::editor::layout_designer::LayoutDesignerWindow::PalettePanel::priority.
Referenced by DrawPalette().

|
private |
Definition at line 1363 of file layout_designer_window.cc.
|
private |
Definition at line 1367 of file layout_designer_window.cc.
References yaze::editor::layout_designer::LayoutDesignerWindow::PalettePanel::description, yaze::editor::layout_designer::LayoutDesignerWindow::PalettePanel::id, and yaze::editor::layout_designer::LayoutDesignerWindow::PalettePanel::name.
Referenced by DrawPalette().
|
private |
Definition at line 177 of file layout_designer_window.h.
Referenced by PushUndoState(), Redo(), and Undo().
|
private |
Definition at line 178 of file layout_designer_window.h.
Referenced by PushUndoState(), Redo(), and Undo().
|
staticconstexprprivate |
Definition at line 179 of file layout_designer_window.h.
Referenced by PushUndoState().
|
private |
|
private |
Definition at line 187 of file layout_designer_window.h.
Referenced by Draw(), DrawCodePreview(), DrawMenuBar(), and DrawToolbar().
|
private |
Definition at line 188 of file layout_designer_window.h.
Referenced by DrawMenuBar(), and DrawProperties().
|
private |
Definition at line 191 of file layout_designer_window.h.
Referenced by Draw(), DrawCodePreview(), and DrawToolbar().
|
private |
Definition at line 194 of file layout_designer_window.h.
Referenced by DeleteNode(), DeletePanel(), DrawCanvas(), DrawMenuBar(), DrawProperties(), DrawToolbar(), DrawTreeView(), GenerateDockBuilderCode(), GenerateLayoutPresetCode(), Open(), PushUndoState(), Redo(), and Undo().
|
private |
Definition at line 197 of file layout_designer_window.h.
Referenced by DrawCodePreview(), and DrawToolbar().
|
private |
Definition at line 198 of file layout_designer_window.h.
|
private |
Definition at line 201 of file layout_designer_window.h.
|
private |
Definition at line 202 of file layout_designer_window.h.
|
private |
Definition at line 203 of file layout_designer_window.h.
Referenced by Draw(), and DrawMenuBar().
|
private |
Definition at line 206 of file layout_designer_window.h.
Referenced by DeleteNode(), DeletePanel(), DrawDockNode(), DrawDockNodeTree(), DrawMenuBar(), DrawProperties(), Redo(), and Undo().
|
private |
Definition at line 207 of file layout_designer_window.h.
Referenced by DeleteNode(), DrawDockNode(), DrawDockNodeTree(), DrawProperties(), Redo(), and Undo().
|
private |
Definition at line 208 of file layout_designer_window.h.
|
private |
Definition at line 211 of file layout_designer_window.h.
|
private |
Definition at line 214 of file layout_designer_window.h.
Referenced by DrawCanvas(), and DrawPalette().
|
private |
Definition at line 215 of file layout_designer_window.h.
Referenced by DrawPalette().
|
private |
Definition at line 216 of file layout_designer_window.h.
|
private |
Definition at line 217 of file layout_designer_window.h.
|
private |
Definition at line 218 of file layout_designer_window.h.
|
private |
Definition at line 219 of file layout_designer_window.h.
|
private |
Definition at line 222 of file layout_designer_window.h.
Referenced by Initialize().
|
private |
Definition at line 223 of file layout_designer_window.h.
Referenced by Initialize().
|
private |
Definition at line 225 of file layout_designer_window.h.
Referenced by DrawMenuBar(), GetAvailablePanels(), and Initialize().
|
private |
Definition at line 228 of file layout_designer_window.h.
Referenced by DrawPalette().
|
private |
Definition at line 229 of file layout_designer_window.h.
Referenced by DrawPalette().
|
private |
Definition at line 232 of file layout_designer_window.h.
|
private |
Definition at line 233 of file layout_designer_window.h.
|
mutableprivate |
Definition at line 236 of file layout_designer_window.h.
Referenced by GetAvailablePanels().
|
mutableprivate |
Definition at line 237 of file layout_designer_window.h.
Referenced by GetAvailablePanels().
|
private |
Definition at line 240 of file layout_designer_window.h.
|
private |
Definition at line 241 of file layout_designer_window.h.
Referenced by DrawCanvas(), and DrawMenuBar().