A session-aware status bar displayed at the bottom of the application. More...
#include <status_bar.h>

Classes | |
| struct | CustomSegment |
Public Member Functions | |
| StatusBar ()=default | |
| ~StatusBar ()=default | |
| void | Initialize (GlobalEditorContext *context) |
| void | SetEnabled (bool enabled) |
| Enable or disable the status bar. | |
| bool | IsEnabled () const |
| void | SetRom (Rom *rom) |
| Set the current ROM for dirty status and filename display. | |
| void | SetSessionInfo (size_t session_id, size_t total_sessions) |
| Set session information. | |
| void | SetCursorPosition (int x, int y, const char *label="Pos") |
| Set cursor/mouse position in editor coordinates. | |
| void | SetCursorPosition (int x, int y, const char *label, StatusBarSegmentOptions options) |
| void | ClearCursorPosition () |
| Clear cursor position (no cursor in editor) | |
| void | SetSelection (int count, int width=0, int height=0) |
| Set selection information. | |
| void | ClearSelection () |
| Clear selection info. | |
| void | SetZoom (float level) |
| Set current zoom level. | |
| void | SetZoom (float level, StatusBarSegmentOptions options) |
| void | ClearZoom () |
| Clear zoom display. | |
| void | SetEditorMode (const std::string &mode) |
| Set the current editor mode or tool. | |
| void | SetEditorMode (const std::string &mode, StatusBarSegmentOptions options) |
| void | ClearEditorMode () |
| Clear editor mode display. | |
| void | SetCustomSegment (const std::string &key, const std::string &value) |
| Set a custom segment with key-value pair. | |
| void | SetCustomSegment (const std::string &key, const std::string &value, StatusBarSegmentOptions options) |
| void | ClearCustomSegment (const std::string &key) |
| Remove a custom segment. | |
| void | ClearAllContext () |
| Clear all context (cursor, selection, zoom, mode, custom) | |
| void | ClearEditorContributions () |
| Clear frame-scoped editor contributions. | |
| void | SetAgentInfo (const std::string &provider, const std::string &model, bool active) |
| void | ClearAgentInfo () |
| void | SetBuildStatus (const ProjectWorkflowStatus &status) |
| void | SetRunStatus (const ProjectWorkflowStatus &status) |
| void | ClearProjectWorkflowStatus () |
| void | SetAgentToggleCallback (std::function< void()> callback) |
| void | Draw () |
| Draw the status bar. | |
| float | GetHeight () const |
| Get the height of the status bar. | |
Static Public Attributes | |
| static constexpr float | kStatusBarHeight = 24.0f |
| static constexpr float | kStatusBarTouchHeight = 44.0f |
Private Member Functions | |
| void | HandleStatusUpdate (const StatusUpdateEvent &event) |
| void | DrawRomSegment () |
| void | DrawSessionSegment () |
| void | DrawCursorSegment () |
| void | DrawSelectionSegment () |
| void | DrawZoomSegment () |
| void | DrawModeSegment () |
| void | DrawAgentSegment () |
| void | DrawProjectWorkflowSegment (const ProjectWorkflowStatus &status, const char *default_icon) |
| void | DrawCustomSegments () |
| void | DrawSeparator () |
Private Attributes | |
| GlobalEditorContext * | context_ = nullptr |
| bool | enabled_ = false |
| Rom * | rom_ = nullptr |
| size_t | session_id_ = 0 |
| size_t | total_sessions_ = 1 |
| bool | has_cursor_ = false |
| int | cursor_x_ = 0 |
| int | cursor_y_ = 0 |
| std::string | cursor_label_ = "Pos" |
| StatusBarSegmentOptions | cursor_options_ |
| bool | has_selection_ = false |
| int | selection_count_ = 0 |
| int | selection_width_ = 0 |
| int | selection_height_ = 0 |
| bool | has_zoom_ = false |
| float | zoom_level_ = 1.0f |
| StatusBarSegmentOptions | zoom_options_ |
| bool | has_mode_ = false |
| std::string | editor_mode_ |
| StatusBarSegmentOptions | mode_options_ |
| std::vector< CustomSegment > | custom_segments_ |
| bool | has_agent_ = false |
| bool | agent_active_ = false |
| std::string | agent_provider_ |
| std::string | agent_model_ |
| std::function< void()> | agent_toggle_callback_ |
| ProjectWorkflowStatus | build_status_ |
| ProjectWorkflowStatus | run_status_ |
A session-aware status bar displayed at the bottom of the application.
The StatusBar sits outside the ImGui dockspace (like the sidebars) and displays:
Each editor can update its relevant segments by calling the Set* methods or publishing StatusUpdateEvents to the event bus.
Usage:
Definition at line 54 of file status_bar.h.
|
default |
|
default |
| void yaze::editor::StatusBar::Initialize | ( | GlobalEditorContext * | context | ) |
Definition at line 90 of file status_bar.cc.
References ClearSelection(), context_, yaze::editor::GlobalEditorContext::GetEventBus(), HandleStatusUpdate(), SetSelection(), SetZoom(), and yaze::EventBus::Subscribe().
Referenced by yaze::editor::EditorManager::EditorManager().
|
inline |
Enable or disable the status bar.
Definition at line 68 of file status_bar.h.
References enabled_.
Referenced by yaze::editor::MenuOrchestrator::AddAppearanceMenuItems(), yaze::editor::SettingsPanel::DrawAppearanceSettings(), yaze::editor::EditorManager::LoadAssets(), and yaze::editor::EditorManager::LoadAssetsLazy().
|
inline |
Definition at line 69 of file status_bar.h.
References enabled_.
|
inline |
Set the current ROM for dirty status and filename display.
Definition at line 74 of file status_bar.h.
References rom_.
Referenced by yaze::editor::EditorManager::DrawInterface().
| void yaze::editor::StatusBar::SetSessionInfo | ( | size_t | session_id, |
| size_t | total_sessions ) |
Set session information.
| session_id | Current session index (0-based) |
| total_sessions | Total number of open sessions |
Definition at line 140 of file status_bar.cc.
References session_id_, and total_sessions_.
Referenced by yaze::editor::EditorManager::DrawInterface().
| void yaze::editor::StatusBar::SetCursorPosition | ( | int | x, |
| int | y, | ||
| const char * | label = "Pos" ) |
Set cursor/mouse position in editor coordinates.
| x | X coordinate (tile, pixel, or editor-specific) |
| y | Y coordinate (tile, pixel, or editor-specific) |
| label | Optional label (e.g., "Tile", "Pos", "Map") |
Definition at line 145 of file status_bar.cc.
References cursor_label_, cursor_options_, cursor_x_, cursor_y_, and has_cursor_.
Referenced by HandleStatusUpdate().
| void yaze::editor::StatusBar::SetCursorPosition | ( | int | x, |
| int | y, | ||
| const char * | label, | ||
| StatusBarSegmentOptions | options ) |
Definition at line 153 of file status_bar.cc.
References cursor_label_, cursor_options_, cursor_x_, cursor_y_, and has_cursor_.
| void yaze::editor::StatusBar::ClearCursorPosition | ( | ) |
Clear cursor position (no cursor in editor)
Definition at line 162 of file status_bar.cc.
References cursor_options_, and has_cursor_.
Referenced by ClearAllContext().
| void yaze::editor::StatusBar::SetSelection | ( | int | count, |
| int | width = 0, | ||
| int | height = 0 ) |
Set selection information.
| count | Number of selected items |
| width | Width of selection (optional, 0 to hide) |
| height | Height of selection (optional, 0 to hide) |
Definition at line 167 of file status_bar.cc.
References has_selection_, selection_count_, selection_height_, and selection_width_.
Referenced by yaze::editor::GraphicsEditor::ContributeStatus(), HandleStatusUpdate(), and Initialize().
| void yaze::editor::StatusBar::ClearSelection | ( | ) |
Clear selection info.
Definition at line 174 of file status_bar.cc.
References has_selection_.
Referenced by ClearAllContext(), and Initialize().
| void yaze::editor::StatusBar::SetZoom | ( | float | level | ) |
Set current zoom level.
| level | Zoom multiplier (e.g., 1.0, 2.0, 0.5) |
Definition at line 178 of file status_bar.cc.
References has_zoom_, zoom_level_, and zoom_options_.
Referenced by HandleStatusUpdate(), and Initialize().
| void yaze::editor::StatusBar::SetZoom | ( | float | level, |
| StatusBarSegmentOptions | options ) |
Definition at line 184 of file status_bar.cc.
References has_zoom_, zoom_level_, and zoom_options_.
| void yaze::editor::StatusBar::ClearZoom | ( | ) |
Clear zoom display.
Definition at line 190 of file status_bar.cc.
References has_zoom_, and zoom_options_.
Referenced by ClearAllContext().
| void yaze::editor::StatusBar::SetEditorMode | ( | const std::string & | mode | ) |
Set the current editor mode or tool.
| mode | Mode string (e.g., "Draw", "Select", "Entity") |
Definition at line 195 of file status_bar.cc.
References editor_mode_, has_mode_, and mode_options_.
Referenced by yaze::editor::DungeonEditorV2::ContributeStatus(), yaze::editor::OverworldEditor::ContributeStatus(), and HandleStatusUpdate().
| void yaze::editor::StatusBar::SetEditorMode | ( | const std::string & | mode, |
| StatusBarSegmentOptions | options ) |
Definition at line 201 of file status_bar.cc.
References editor_mode_, has_mode_, and mode_options_.
| void yaze::editor::StatusBar::ClearEditorMode | ( | ) |
Clear editor mode display.
Definition at line 208 of file status_bar.cc.
References editor_mode_, has_mode_, and mode_options_.
Referenced by ClearAllContext(), and ClearEditorContributions().
| void yaze::editor::StatusBar::SetCustomSegment | ( | const std::string & | key, |
| const std::string & | value ) |
Set a custom segment with key-value pair.
| key | Segment identifier |
| value | Value to display |
Definition at line 214 of file status_bar.cc.
References SetCustomSegment().
Referenced by yaze::editor::DungeonEditorV2::ContributeStatus(), yaze::editor::GraphicsEditor::ContributeStatus(), yaze::editor::OverworldEditor::ContributeStatus(), and SetCustomSegment().

| void yaze::editor::StatusBar::SetCustomSegment | ( | const std::string & | key, |
| const std::string & | value, | ||
| StatusBarSegmentOptions | options ) |
Definition at line 219 of file status_bar.cc.
References custom_segments_.
| void yaze::editor::StatusBar::ClearCustomSegment | ( | const std::string & | key | ) |
| void yaze::editor::StatusBar::ClearAllContext | ( | ) |
Clear all context (cursor, selection, zoom, mode, custom)
Definition at line 239 of file status_bar.cc.
References ClearCursorPosition(), ClearEditorMode(), ClearSelection(), ClearZoom(), and custom_segments_.

| void yaze::editor::StatusBar::ClearEditorContributions | ( | ) |
Clear frame-scoped editor contributions.
Use this before calling Editor::ContributeStatus() each frame. It resets mode/custom segments without wiping event-driven cursor, selection, or zoom state that may still be owned by older editors.
Definition at line 247 of file status_bar.cc.
References ClearEditorMode(), and custom_segments_.
Referenced by yaze::editor::EditorManager::DrawInterface(), and HandleStatusUpdate().

| void yaze::editor::StatusBar::SetAgentInfo | ( | const std::string & | provider, |
| const std::string & | model, | ||
| bool | active ) |
Definition at line 252 of file status_bar.cc.
References agent_active_, agent_model_, agent_provider_, and has_agent_.
Referenced by yaze::editor::EditorManager::DrawInterface().
| void yaze::editor::StatusBar::ClearAgentInfo | ( | ) |
Definition at line 260 of file status_bar.cc.
References agent_active_, agent_model_, agent_provider_, and has_agent_.
Referenced by yaze::editor::EditorManager::DrawInterface().
|
inline |
Definition at line 174 of file status_bar.h.
References build_status_.
Referenced by yaze::editor::anonymous_namespace{editor_manager.cc}::UpdateBuildWorkflowStatus().
|
inline |
Definition at line 177 of file status_bar.h.
References run_status_.
Referenced by yaze::editor::anonymous_namespace{editor_manager.cc}::UpdateRunWorkflowStatus().
|
inline |
Definition at line 178 of file status_bar.h.
References build_status_, and run_status_.
Referenced by yaze::editor::EditorManager::DrawInterface(), and yaze::editor::EditorManager::LoadProjectWithRom().
|
inline |
Definition at line 182 of file status_bar.h.
References agent_toggle_callback_.
Referenced by yaze::editor::EditorManager::InitializeSubsystems().
| void yaze::editor::StatusBar::Draw | ( | ) |
Draw the status bar.
Should be called each frame. The status bar positions itself at the bottom of the viewport, outside the dockspace.
Definition at line 267 of file status_bar.cc.
References agent_model_, agent_provider_, yaze::gui::LayoutHelpers::SafeAreaInsets::bottom, build_status_, DrawAgentSegment(), DrawCursorSegment(), DrawCustomSegments(), DrawModeSegment(), DrawProjectWorkflowSegment(), DrawRomSegment(), DrawSelectionSegment(), DrawSeparator(), DrawSessionSegment(), DrawZoomSegment(), editor_mode_, enabled_, GetHeight(), yaze::gui::GetOutlineVec4(), yaze::gui::LayoutHelpers::GetSafeAreaInsets(), yaze::gui::GetSurfaceContainerVec4(), has_agent_, has_cursor_, has_mode_, has_selection_, has_zoom_, ICON_MD_BUILD, ICON_MD_PLAY_ARROW, ICON_MD_SMART_TOY, yaze::gui::LayoutHelpers::IsTouchDevice(), run_status_, total_sessions_, and yaze::editor::ProjectWorkflowStatus::visible.
Referenced by yaze::editor::EditorManager::DrawInterface().
| float yaze::editor::StatusBar::GetHeight | ( | ) | const |
Get the height of the status bar.
Definition at line 80 of file status_bar.cc.
References enabled_, yaze::gui::LayoutHelpers::IsTouchDevice(), kStatusBarHeight, and kStatusBarTouchHeight.
Referenced by Draw(), and yaze::editor::LayoutCoordinator::GetBottomLayoutOffset().

|
private |
Definition at line 113 of file status_bar.cc.
References yaze::editor::StatusUpdateEvent::Clear, ClearEditorContributions(), yaze::editor::StatusUpdateEvent::count, yaze::editor::StatusUpdateEvent::Cursor, yaze::editor::StatusUpdateEvent::height, yaze::editor::StatusUpdateEvent::Mode, yaze::editor::StatusUpdateEvent::Selection, SetCursorPosition(), SetEditorMode(), SetSelection(), SetZoom(), yaze::editor::StatusUpdateEvent::text, yaze::editor::StatusUpdateEvent::type, yaze::editor::StatusUpdateEvent::width, yaze::editor::StatusUpdateEvent::x, yaze::editor::StatusUpdateEvent::y, yaze::editor::StatusUpdateEvent::Zoom, and yaze::editor::StatusUpdateEvent::zoom.
Referenced by Initialize().
|
private |
Definition at line 462 of file status_bar.cc.
References yaze::gui::ColoredText(), yaze::gui::ColoredTextF(), yaze::gui::ConvertColorToImVec4(), yaze::Rom::dirty(), yaze::gui::ThemeManager::Get(), yaze::gui::ThemeManager::GetCurrentTheme(), yaze::gui::GetTextSecondaryVec4(), ICON_MD_DESCRIPTION, ICON_MD_FIBER_MANUAL_RECORD, yaze::Rom::is_loaded(), rom_, and yaze::Rom::short_name().
Referenced by Draw().
|
private |
Definition at line 486 of file status_bar.cc.
References yaze::gui::ColoredTextF(), yaze::gui::GetTextSecondaryVec4(), ICON_MD_LAYERS, session_id_, and total_sessions_.
Referenced by Draw().

|
private |
Definition at line 495 of file status_bar.cc.
References yaze::gui::ColoredTextF(), cursor_label_, cursor_options_, cursor_x_, cursor_y_, and yaze::gui::GetTextSecondaryVec4().
Referenced by Draw().

|
private |
Definition at line 501 of file status_bar.cc.
References yaze::gui::GetTextSecondaryVec4(), ICON_MD_SELECT_ALL, selection_count_, selection_height_, and selection_width_.
Referenced by Draw().

|
private |
Definition at line 513 of file status_bar.cc.
References yaze::gui::ColoredTextF(), yaze::gui::GetTextSecondaryVec4(), ICON_MD_ZOOM_IN, yaze::editor::StatusBarSegmentOptions::on_click, yaze::editor::StatusBarSegmentOptions::tooltip, zoom_level_, and zoom_options_.
Referenced by Draw().

|
private |
Definition at line 529 of file status_bar.cc.
References yaze::gui::ColoredTextF(), editor_mode_, yaze::gui::GetTextSecondaryVec4(), and mode_options_.
Referenced by Draw().

|
private |
Definition at line 400 of file status_bar.cc.
References agent_active_, agent_model_, agent_provider_, agent_toggle_callback_, yaze::gui::GetPrimaryVec4(), yaze::gui::GetSurfaceContainerHighestVec4(), yaze::gui::GetSurfaceContainerHighVec4(), yaze::gui::GetTextSecondaryVec4(), ICON_MD_SMART_TOY, and yaze::gui::ThemedButton().
Referenced by Draw().
|
private |
Definition at line 437 of file status_bar.cc.
References yaze::gui::ColoredTextF(), yaze::editor::ProjectWorkflowStatus::detail, yaze::editor::ProjectWorkflowStatus::label, yaze::editor::ProjectWorkflowStatus::output_tail, yaze::editor::ProjectWorkflowStatus::state, and yaze::editor::ProjectWorkflowStatus::summary.
Referenced by Draw().

|
private |
Definition at line 534 of file status_bar.cc.
References yaze::gui::ColoredTextF(), custom_segments_, DrawSeparator(), and yaze::gui::GetTextSecondaryVec4().
Referenced by Draw().

|
private |
Definition at line 543 of file status_bar.cc.
References yaze::gui::ColoredText(), and yaze::gui::GetOutlineVec4().
Referenced by Draw(), and DrawCustomSegments().

|
staticconstexpr |
Definition at line 204 of file status_bar.h.
Referenced by GetHeight().
|
staticconstexpr |
Definition at line 205 of file status_bar.h.
Referenced by GetHeight().
|
private |
Definition at line 222 of file status_bar.h.
Referenced by Initialize().
|
private |
Definition at line 223 of file status_bar.h.
Referenced by Draw(), GetHeight(), IsEnabled(), and SetEnabled().
|
private |
Definition at line 224 of file status_bar.h.
Referenced by DrawRomSegment(), and SetRom().
|
private |
Definition at line 227 of file status_bar.h.
Referenced by DrawSessionSegment(), and SetSessionInfo().
|
private |
Definition at line 228 of file status_bar.h.
Referenced by Draw(), DrawSessionSegment(), and SetSessionInfo().
|
private |
Definition at line 231 of file status_bar.h.
Referenced by ClearCursorPosition(), Draw(), SetCursorPosition(), and SetCursorPosition().
|
private |
Definition at line 232 of file status_bar.h.
Referenced by DrawCursorSegment(), SetCursorPosition(), and SetCursorPosition().
|
private |
Definition at line 233 of file status_bar.h.
Referenced by DrawCursorSegment(), SetCursorPosition(), and SetCursorPosition().
|
private |
Definition at line 234 of file status_bar.h.
Referenced by DrawCursorSegment(), SetCursorPosition(), and SetCursorPosition().
|
private |
Definition at line 235 of file status_bar.h.
Referenced by ClearCursorPosition(), DrawCursorSegment(), SetCursorPosition(), and SetCursorPosition().
|
private |
Definition at line 238 of file status_bar.h.
Referenced by ClearSelection(), Draw(), and SetSelection().
|
private |
Definition at line 239 of file status_bar.h.
Referenced by DrawSelectionSegment(), and SetSelection().
|
private |
Definition at line 240 of file status_bar.h.
Referenced by DrawSelectionSegment(), and SetSelection().
|
private |
Definition at line 241 of file status_bar.h.
Referenced by DrawSelectionSegment(), and SetSelection().
|
private |
Definition at line 244 of file status_bar.h.
Referenced by ClearZoom(), Draw(), SetZoom(), and SetZoom().
|
private |
Definition at line 245 of file status_bar.h.
Referenced by DrawZoomSegment(), SetZoom(), and SetZoom().
|
private |
Definition at line 246 of file status_bar.h.
Referenced by ClearZoom(), DrawZoomSegment(), SetZoom(), and SetZoom().
|
private |
Definition at line 249 of file status_bar.h.
Referenced by ClearEditorMode(), Draw(), SetEditorMode(), and SetEditorMode().
|
private |
Definition at line 250 of file status_bar.h.
Referenced by ClearEditorMode(), Draw(), DrawModeSegment(), SetEditorMode(), and SetEditorMode().
|
private |
Definition at line 251 of file status_bar.h.
Referenced by ClearEditorMode(), DrawModeSegment(), SetEditorMode(), and SetEditorMode().
|
private |
Definition at line 259 of file status_bar.h.
Referenced by ClearAllContext(), ClearCustomSegment(), ClearEditorContributions(), DrawCustomSegments(), and SetCustomSegment().
|
private |
Definition at line 262 of file status_bar.h.
Referenced by ClearAgentInfo(), Draw(), and SetAgentInfo().
|
private |
Definition at line 263 of file status_bar.h.
Referenced by ClearAgentInfo(), DrawAgentSegment(), and SetAgentInfo().
|
private |
Definition at line 264 of file status_bar.h.
Referenced by ClearAgentInfo(), Draw(), DrawAgentSegment(), and SetAgentInfo().
|
private |
Definition at line 265 of file status_bar.h.
Referenced by ClearAgentInfo(), Draw(), DrawAgentSegment(), and SetAgentInfo().
|
private |
Definition at line 266 of file status_bar.h.
Referenced by DrawAgentSegment(), and SetAgentToggleCallback().
|
private |
Definition at line 268 of file status_bar.h.
Referenced by ClearProjectWorkflowStatus(), Draw(), and SetBuildStatus().
|
private |
Definition at line 269 of file status_bar.h.
Referenced by ClearProjectWorkflowStatus(), Draw(), and SetRunStatus().