Draggable, dockable panel for editor sub-windows. More...
#include <editor_layout.h>
Classes | |
| struct | HeaderButton |
Public Types | |
| enum class | Position { Free , Right , Left , Bottom , Top , Center , Floating } |
Public Member Functions | |
| PanelWindow (const char *title, const char *icon=nullptr) | |
| PanelWindow (const char *title, const char *icon, bool *p_open) | |
| void | SetDefaultSize (float width, float height) |
| void | SetPosition (Position pos) |
| void | SetStableId (const std::string &stable_id) |
| void | SetMinimizable (bool minimizable) |
| void | SetClosable (bool closable) |
| void | SetHeadless (bool headless) |
| void | SetDockingAllowed (bool allowed) |
| void | SetIconCollapsible (bool collapsible) |
| void | SetPinnable (bool pinnable) |
| void | SetSaveSettings (bool save) |
| void | SetStartOffset (const ImVec2 &offset) |
| void | AddHeaderButton (const char *icon, const char *tooltip, std::function< void()> callback) |
| bool | Begin (bool *p_open=nullptr) |
| void | End () |
| void | SetMinimized (bool minimized) |
| bool | IsMinimized () const |
| void | SetPinned (bool pinned) |
| bool | IsPinned () const |
| void | SetPinChangedCallback (std::function< void(bool)> callback) |
| void | Focus () |
| bool | IsFocused () const |
| const char * | GetWindowName () const |
Static Public Member Functions | |
| static void | ResetFrameTracking () |
| static bool | HasDuplicateRendering () |
| static const std::string & | GetDuplicatePanelName () |
Private Member Functions | |
| void | DrawFloatingIconButton () |
| void | DrawHeaderButtons () |
| void | UpdateWindowName () |
Private Attributes | |
| std::string | title_ |
| std::string | icon_ |
| std::string | window_name_ |
| std::string | stable_id_ |
| ImVec2 | default_size_ |
| bool | default_size_set_ = false |
| Position | position_ = Position::Free |
| bool | minimizable_ = true |
| bool | closable_ = true |
| bool | minimized_ = false |
| bool | first_draw_ = true |
| bool | focused_ = false |
| bool * | p_open_ = nullptr |
| bool | imgui_begun_ = false |
| bool | headless_ = false |
| bool | docking_allowed_ = true |
| bool | icon_collapsible_ = false |
| bool | collapsed_to_icon_ = false |
| ImVec2 | saved_icon_pos_ = ImVec2(10, 100) |
| ImVec2 | start_offset_ = ImVec2(0, 0) |
| bool | start_offset_set_ = false |
| bool | pinnable_ = false |
| bool | pinned_ = false |
| std::function< void(bool)> | on_pin_changed_ |
| bool | save_settings_ = true |
| std::vector< HeaderButton > | header_buttons_ |
| std::optional< StyleVarGuard > | panel_var_guard_ |
| std::optional< StyleColorGuard > | panel_color_guard_ |
Static Private Attributes | |
| static int | last_frame_count_ = 0 |
| static std::vector< std::string > | panels_begun_this_frame_ |
| static bool | duplicate_detected_ = false |
| static std::string | duplicate_panel_name_ |
Draggable, dockable panel for editor sub-windows.
Replaces traditional child windows with modern panels that can be:
Usage:
Definition at line 112 of file editor_layout.h.
|
strong |
| Enumerator | |
|---|---|
| Free | |
| Right | |
| Left | |
| Bottom | |
| Top | |
| Center | |
| Floating | |
Definition at line 114 of file editor_layout.h.
|
explicit |
Definition at line 241 of file editor_layout.cc.
References UpdateWindowName().

| yaze::gui::PanelWindow::PanelWindow | ( | const char * | title, |
| const char * | icon, | ||
| bool * | p_open ) |
Definition at line 246 of file editor_layout.cc.
References p_open_, and UpdateWindowName().

|
inlinestatic |
Definition at line 128 of file editor_layout.h.
References last_frame_count_, and panels_begun_this_frame_.
|
inlinestatic |
Definition at line 134 of file editor_layout.h.
References duplicate_detected_.
|
inlinestatic |
Definition at line 135 of file editor_layout.h.
References duplicate_panel_name_.
| void yaze::gui::PanelWindow::SetDefaultSize | ( | float | width, |
| float | height ) |
Definition at line 252 of file editor_layout.cc.
References default_size_, and default_size_set_.
Referenced by yaze::editor::DashboardPanel::DashboardPanel(), yaze::editor::PanelManager::DrawAllVisiblePanels(), yaze::emu::Emulator::RenderEmulatorInterface(), and yaze::editor::DungeonEditorV2::Update().
| void yaze::gui::PanelWindow::SetPosition | ( | Position | pos | ) |
Definition at line 257 of file editor_layout.cc.
References position_.
Referenced by yaze::editor::DashboardPanel::DashboardPanel(), and yaze::editor::PanelManager::DrawAllVisiblePanels().
| void yaze::gui::PanelWindow::SetStableId | ( | const std::string & | stable_id | ) |
Definition at line 261 of file editor_layout.cc.
References stable_id_, and UpdateWindowName().
Referenced by yaze::editor::PanelManager::DrawAllVisiblePanels().

|
inline |
Definition at line 149 of file editor_layout.h.
References minimizable_.
|
inline |
Definition at line 150 of file editor_layout.h.
References closable_.
|
inline |
Definition at line 151 of file editor_layout.h.
References headless_.
|
inline |
Definition at line 152 of file editor_layout.h.
References docking_allowed_.
|
inline |
Definition at line 153 of file editor_layout.h.
References icon_collapsible_.
|
inline |
Definition at line 154 of file editor_layout.h.
References pinnable_.
Referenced by yaze::editor::PanelManager::DrawAllVisiblePanels().
|
inline |
Definition at line 155 of file editor_layout.h.
References save_settings_.
Referenced by yaze::editor::DashboardPanel::DashboardPanel().
|
inline |
Definition at line 156 of file editor_layout.h.
References start_offset_, and start_offset_set_.
| void yaze::gui::PanelWindow::AddHeaderButton | ( | const char * | icon, |
| const char * | tooltip, | ||
| std::function< void()> | callback ) |
Definition at line 266 of file editor_layout.cc.
References header_buttons_.
| bool yaze::gui::PanelWindow::Begin | ( | bool * | p_open = nullptr | ) |
Definition at line 271 of file editor_layout.cc.
References Bottom, Center, yaze::gui::LayoutHelpers::ClampWindowToRect(), closable_, collapsed_to_icon_, default_size_, default_size_set_, docking_allowed_, DrawFloatingIconButton(), DrawHeaderButtons(), duplicate_detected_, duplicate_panel_name_, first_draw_, Floating, Free, yaze::gui::GetAccentColor(), yaze::gui::GetThemeColor(), headless_, icon_collapsible_, imgui_begun_, yaze::gui::WidgetIdRegistry::Instance(), yaze::gui::LayoutHelpers::IsTouchDevice(), last_frame_count_, Left, p_open_, panel_color_guard_, panel_var_guard_, panels_begun_this_frame_, position_, yaze::gui::WidgetIdRegistry::RegisterWidget(), Right, save_settings_, start_offset_, start_offset_set_, title_, Top, and window_name_.
Referenced by yaze::editor::DashboardPanel::Draw(), yaze::editor::PanelManager::DrawAllVisiblePanels(), yaze::emu::Emulator::RenderEmulatorInterface(), and yaze::editor::DungeonEditorV2::Update().
| void yaze::gui::PanelWindow::End | ( | ) |
Definition at line 455 of file editor_layout.cc.
References focused_, imgui_begun_, panel_color_guard_, and panel_var_guard_.
Referenced by yaze::editor::DashboardPanel::Draw(), yaze::editor::PanelManager::DrawAllVisiblePanels(), yaze::emu::Emulator::RenderEmulatorInterface(), and yaze::editor::DungeonEditorV2::Update().
|
inline |
Definition at line 172 of file editor_layout.h.
References minimized_.
|
inline |
Definition at line 173 of file editor_layout.h.
References minimized_.
|
inline |
Definition at line 176 of file editor_layout.h.
References pinned_.
Referenced by yaze::editor::PanelManager::DrawAllVisiblePanels().
|
inline |
Definition at line 177 of file editor_layout.h.
References pinned_.
|
inline |
Definition at line 178 of file editor_layout.h.
References on_pin_changed_.
Referenced by yaze::editor::PanelManager::DrawAllVisiblePanels().
| void yaze::gui::PanelWindow::Focus | ( | ) |
Definition at line 468 of file editor_layout.cc.
References focused_, and window_name_.
|
inline |
Definition at line 184 of file editor_layout.h.
References focused_.
|
inline |
Definition at line 187 of file editor_layout.h.
References window_name_.
|
private |
Definition at line 474 of file editor_layout.cc.
References collapsed_to_icon_, icon_, saved_icon_pos_, title_, and window_name_.
Referenced by Begin().
|
private |
Definition at line 506 of file editor_layout.cc.
Referenced by Begin().
|
private |
Definition at line 520 of file editor_layout.cc.
References icon_, stable_id_, title_, and window_name_.
Referenced by PanelWindow(), PanelWindow(), and SetStableId().
|
staticprivate |
Definition at line 138 of file editor_layout.h.
Referenced by Begin(), and ResetFrameTracking().
|
staticprivate |
Definition at line 139 of file editor_layout.h.
Referenced by Begin(), and ResetFrameTracking().
|
staticprivate |
Definition at line 140 of file editor_layout.h.
Referenced by Begin(), and HasDuplicateRendering().
|
staticprivate |
Definition at line 141 of file editor_layout.h.
Referenced by Begin(), and GetDuplicatePanelName().
|
private |
Definition at line 190 of file editor_layout.h.
Referenced by Begin(), DrawFloatingIconButton(), and UpdateWindowName().
|
private |
Definition at line 191 of file editor_layout.h.
Referenced by DrawFloatingIconButton(), and UpdateWindowName().
|
private |
Definition at line 192 of file editor_layout.h.
Referenced by Begin(), DrawFloatingIconButton(), Focus(), GetWindowName(), and UpdateWindowName().
|
private |
Definition at line 193 of file editor_layout.h.
Referenced by SetStableId(), and UpdateWindowName().
|
private |
Definition at line 194 of file editor_layout.h.
Referenced by Begin(), and SetDefaultSize().
|
private |
Definition at line 195 of file editor_layout.h.
Referenced by Begin(), and SetDefaultSize().
|
private |
Definition at line 196 of file editor_layout.h.
Referenced by Begin(), and SetPosition().
|
private |
Definition at line 197 of file editor_layout.h.
Referenced by SetMinimizable().
|
private |
Definition at line 198 of file editor_layout.h.
Referenced by Begin(), and SetClosable().
|
private |
Definition at line 199 of file editor_layout.h.
Referenced by IsMinimized(), and SetMinimized().
|
private |
Definition at line 200 of file editor_layout.h.
Referenced by Begin().
|
private |
Definition at line 201 of file editor_layout.h.
Referenced by End(), Focus(), and IsFocused().
|
private |
Definition at line 202 of file editor_layout.h.
Referenced by Begin(), and PanelWindow().
|
private |
Definition at line 203 of file editor_layout.h.
|
private |
Definition at line 206 of file editor_layout.h.
Referenced by Begin(), and SetHeadless().
|
private |
Definition at line 207 of file editor_layout.h.
Referenced by Begin(), and SetDockingAllowed().
|
private |
Definition at line 208 of file editor_layout.h.
Referenced by Begin(), and SetIconCollapsible().
|
private |
Definition at line 209 of file editor_layout.h.
Referenced by Begin(), and DrawFloatingIconButton().
|
private |
Definition at line 210 of file editor_layout.h.
Referenced by DrawFloatingIconButton().
|
private |
Definition at line 211 of file editor_layout.h.
Referenced by Begin(), and SetStartOffset().
|
private |
Definition at line 212 of file editor_layout.h.
Referenced by Begin(), and SetStartOffset().
|
private |
Definition at line 215 of file editor_layout.h.
Referenced by SetPinnable().
|
private |
Definition at line 216 of file editor_layout.h.
Referenced by IsPinned(), and SetPinned().
|
private |
Definition at line 217 of file editor_layout.h.
Referenced by SetPinChangedCallback().
|
private |
Definition at line 220 of file editor_layout.h.
Referenced by Begin(), and SetSaveSettings().
|
private |
Definition at line 228 of file editor_layout.h.
Referenced by AddHeaderButton().
|
private |
Definition at line 234 of file editor_layout.h.
|
private |
Definition at line 235 of file editor_layout.h.