yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
right_panel_manager.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_MENU_RIGHT_PANEL_MANAGER_H_
2#define YAZE_APP_EDITOR_MENU_RIGHT_PANEL_MANAGER_H_
3
4#include <functional>
5#include <string>
6
7#include "app/editor/editor.h"
8#include "imgui/imgui.h"
9
10namespace yaze {
11
12class Rom;
13
14namespace project {
15struct YazeProject;
16}
17
18namespace core {
19class VersionManager;
20}
21
22namespace editor {
23
24// Forward declarations
25class ProposalDrawer;
26class ToastManager;
27class AgentChat;
28class SettingsPanel;
29class SelectionPropertiesPanel;
30class ProjectManagementPanel;
31
52 public:
53 enum class PanelType {
54 kNone = 0,
58 kHelp,
59 kNotifications, // Full notification history panel
60 kProperties, // Full-editing properties panel
61 kProject // Project management panel
62 };
63
64 RightPanelManager() = default;
65 ~RightPanelManager() = default;
66
67 // Non-copyable
70
71 // ============================================================================
72 // Configuration
73 // ============================================================================
74
75 void SetAgentChat(AgentChat* chat) { agent_chat_ = chat; }
84 void SetToastManager(ToastManager* manager) { toast_manager_ = manager; }
85 void SetRom(Rom* rom) { rom_ = rom; }
86
92
93 // ============================================================================
94 // Panel Control
95 // ============================================================================
96
104 void TogglePanel(PanelType type);
105
110 void OpenPanel(PanelType type);
111
115 void ClosePanel();
116
121
126
130 bool IsPanelActive(PanelType type) const { return active_panel_ == type; }
131
132 // ============================================================================
133 // Dimensions
134 // ============================================================================
135
139 float GetPanelWidth() const;
140
144 static constexpr float GetCollapsedWidth() { return 0.0f; }
145
149 void SetPanelWidth(PanelType type, float width);
150
151 // ============================================================================
152 // Rendering
153 // ============================================================================
154
161 void Draw();
162
169
170 // ============================================================================
171 // Panel-specific accessors
172 // ============================================================================
173
174 AgentChat* agent_chat() const { return agent_chat_; }
179
180 private:
181 void DrawPanelHeader(const char* title, const char* icon);
182 void DrawAgentChatPanel();
183 void DrawProposalsPanel();
184 void DrawSettingsPanel();
185 void DrawHelpPanel();
187 void DrawPropertiesPanel();
188 void DrawProjectPanel();
189
190 // Help panel helpers for context-aware content
192 void DrawGlobalShortcuts();
196 void DrawAboutSection();
197
198 // Styling helpers for consistent panel UI
199 bool BeginPanelSection(const char* label, const char* icon = nullptr,
200 bool default_open = true);
201 void EndPanelSection();
202 void DrawPanelDivider();
203 void DrawPanelLabel(const char* label);
204 void DrawPanelValue(const char* label, const char* value);
205 void DrawPanelDescription(const char* text);
206
207 // Active panel
209
210 // Active editor for context-aware help
212
213 // Panel widths (customizable per panel type) - consistent sizing
214 float agent_chat_width_ = 420.0f; // Match proposals for consistency
215 float proposals_width_ = 420.0f;
216 float settings_width_ = 420.0f; // Same width for unified look
217 float help_width_ = 380.0f; // Wider for better readability
218 float notifications_width_ = 420.0f;
219 float properties_width_ = 320.0f; // Narrower for properties
220 float project_width_ = 380.0f; // Project management panel
221
222 // Component references (not owned)
229 Rom* rom_ = nullptr;
230
231 // Animation state
232 float panel_animation_ = 0.0f;
233 bool animating_ = false;
234};
235
240
245
246} // namespace editor
247} // namespace yaze
248
249#endif // YAZE_APP_EDITOR_MENU_RIGHT_PANEL_MANAGER_H_
250
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:24
Unified Agent Chat Component.
Definition agent_chat.h:31
Panel for managing project settings, ROM versions, and snapshots.
ImGui drawer for displaying and managing agent proposals.
Manages right-side sliding panels for agent chat, proposals, settings.
void SetSettingsPanel(SettingsPanel *panel)
void Draw()
Draw the panel and its contents.
void SetPropertiesPanel(SelectionPropertiesPanel *panel)
float GetPanelWidth() const
Get the width of the panel when expanded.
ProposalDrawer * proposal_drawer() const
void ClosePanel()
Close the currently active panel.
void SetActiveEditor(EditorType type)
Set the active editor for context-aware help content.
void DrawPanelValue(const char *label, const char *value)
void SetPanelWidth(PanelType type, float width)
Set panel width for a specific panel type.
SelectionPropertiesPanel * properties_panel() const
static constexpr float GetCollapsedWidth()
Get the width of the collapsed panel strip (toggle buttons)
void TogglePanel(PanelType type)
Toggle a specific panel on/off.
bool BeginPanelSection(const char *label, const char *icon=nullptr, bool default_open=true)
PanelType GetActivePanel() const
Get the currently active panel type.
SettingsPanel * settings_panel() const
void SetProposalDrawer(ProposalDrawer *drawer)
bool IsPanelExpanded() const
Check if any panel is currently expanded.
bool DrawPanelToggleButtons()
Draw toggle buttons for the status cluster.
bool IsPanelActive(PanelType type) const
Check if a specific panel is active.
RightPanelManager & operator=(const RightPanelManager &)=delete
void OpenPanel(PanelType type)
Open a specific panel.
void DrawPanelLabel(const char *label)
SelectionPropertiesPanel * properties_panel_
ProjectManagementPanel * project_panel() const
void SetProjectManagementPanel(ProjectManagementPanel *panel)
void DrawPanelDescription(const char *text)
RightPanelManager(const RightPanelManager &)=delete
void DrawPanelHeader(const char *title, const char *icon)
ProjectManagementPanel * project_panel_
void SetToastManager(ToastManager *manager)
Full-editing properties panel for selected entities.
Manages the settings UI displayed in the right sidebar.
const char * GetPanelTypeName(RightPanelManager::PanelType type)
Get the name of a panel type.
const char * GetPanelTypeIcon(RightPanelManager::PanelType type)
Get the icon for a panel type.