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 | 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 | 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 () |
Private Attributes | |
| std::string | title_ |
| std::string | icon_ |
| std::string | window_name_ |
| ImVec2 | default_size_ |
| 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) |
| bool | pinnable_ = false |
| bool | pinned_ = false |
| std::function< void(bool)> | on_pin_changed_ |
| bool | save_settings_ = true |
| std::vector< HeaderButton > | header_buttons_ |
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 108 of file editor_layout.h.
|
strong |
| Enumerator | |
|---|---|
| Free | |
| Right | |
| Left | |
| Bottom | |
| Top | |
| Center | |
| Floating | |
Definition at line 110 of file editor_layout.h.
|
explicit |
Definition at line 237 of file editor_layout.cc.
References icon_, title_, and window_name_.
| yaze::gui::PanelWindow::PanelWindow | ( | const char * | title, |
| const char * | icon, | ||
| bool * | p_open ) |
Definition at line 242 of file editor_layout.cc.
References icon_, p_open_, title_, and window_name_.
|
inlinestatic |
Definition at line 124 of file editor_layout.h.
References last_frame_count_, and panels_begun_this_frame_.
|
inlinestatic |
Definition at line 130 of file editor_layout.h.
References duplicate_detected_.
|
inlinestatic |
Definition at line 131 of file editor_layout.h.
References duplicate_panel_name_.
| void yaze::gui::PanelWindow::SetDefaultSize | ( | float | width, |
| float | height ) |
Definition at line 248 of file editor_layout.cc.
References default_size_.
Referenced by yaze::editor::DashboardPanel::DashboardPanel(), yaze::editor::PanelManager::DrawAllVisiblePanels(), yaze::editor::PaletteEditor::DrawCustomPalettePanel(), yaze::editor::PaletteEditor::DrawQuickAccessPanel(), yaze::emu::Emulator::RenderEmulatorInterface(), and yaze::editor::DungeonEditorV2::Update().
| void yaze::gui::PanelWindow::SetPosition | ( | Position | pos | ) |
Definition at line 252 of file editor_layout.cc.
References position_.
Referenced by yaze::editor::DashboardPanel::DashboardPanel(), yaze::editor::PaletteEditor::DrawCustomPalettePanel(), and yaze::editor::PaletteEditor::DrawQuickAccessPanel().
|
inline |
Definition at line 144 of file editor_layout.h.
References minimizable_.
|
inline |
Definition at line 145 of file editor_layout.h.
References closable_.
|
inline |
Definition at line 146 of file editor_layout.h.
References headless_.
|
inline |
Definition at line 147 of file editor_layout.h.
References docking_allowed_.
|
inline |
Definition at line 148 of file editor_layout.h.
References icon_collapsible_.
|
inline |
Definition at line 149 of file editor_layout.h.
References pinnable_.
Referenced by yaze::editor::PanelManager::DrawAllVisiblePanels().
|
inline |
Definition at line 150 of file editor_layout.h.
References save_settings_.
| void yaze::gui::PanelWindow::AddHeaderButton | ( | const char * | icon, |
| const char * | tooltip, | ||
| std::function< void()> | callback ) |
Definition at line 256 of file editor_layout.cc.
References header_buttons_.
| bool yaze::gui::PanelWindow::Begin | ( | bool * | p_open = nullptr | ) |
Definition at line 260 of file editor_layout.cc.
References Bottom, closable_, collapsed_to_icon_, default_size_, docking_allowed_, DrawFloatingIconButton(), DrawHeaderButtons(), duplicate_detected_, duplicate_panel_name_, first_draw_, Floating, Free, yaze::gui::GetAccentColor(), yaze::gui::GetThemeColor(), headless_, icon_, icon_collapsible_, imgui_begun_, yaze::gui::WidgetIdRegistry::Instance(), last_frame_count_, Left, p_open_, panels_begun_this_frame_, position_, yaze::gui::WidgetIdRegistry::RegisterWidget(), Right, save_settings_, title_, Top, and window_name_.
Referenced by yaze::editor::DashboardPanel::Draw(), yaze::editor::PanelManager::DrawAllVisiblePanels(), yaze::editor::PaletteEditor::DrawCustomPalettePanel(), yaze::editor::PaletteEditor::DrawQuickAccessPanel(), yaze::emu::Emulator::RenderEmulatorInterface(), and yaze::editor::DungeonEditorV2::Update().
| void yaze::gui::PanelWindow::End | ( | ) |
Definition at line 386 of file editor_layout.cc.
References focused_, and imgui_begun_.
Referenced by yaze::editor::DashboardPanel::Draw(), yaze::editor::PanelManager::DrawAllVisiblePanels(), yaze::editor::PaletteEditor::DrawCustomPalettePanel(), yaze::editor::PaletteEditor::DrawQuickAccessPanel(), yaze::emu::Emulator::RenderEmulatorInterface(), and yaze::editor::DungeonEditorV2::Update().
|
inline |
Definition at line 163 of file editor_layout.h.
References minimized_.
|
inline |
Definition at line 164 of file editor_layout.h.
References minimized_.
|
inline |
Definition at line 167 of file editor_layout.h.
References pinned_.
Referenced by yaze::editor::PanelManager::DrawAllVisiblePanels().
|
inline |
Definition at line 168 of file editor_layout.h.
References pinned_.
|
inline |
Definition at line 169 of file editor_layout.h.
References on_pin_changed_.
Referenced by yaze::editor::PanelManager::DrawAllVisiblePanels().
| void yaze::gui::PanelWindow::Focus | ( | ) |
Definition at line 399 of file editor_layout.cc.
References focused_, and window_name_.
|
inline |
Definition at line 175 of file editor_layout.h.
References focused_.
|
inline |
Definition at line 178 of file editor_layout.h.
References window_name_.
|
private |
Definition at line 405 of file editor_layout.cc.
References collapsed_to_icon_, icon_, saved_icon_pos_, title_, and window_name_.
Referenced by Begin().
|
private |
Definition at line 437 of file editor_layout.cc.
Referenced by Begin().
|
staticprivate |
Definition at line 134 of file editor_layout.h.
Referenced by Begin(), and ResetFrameTracking().
|
staticprivate |
Definition at line 135 of file editor_layout.h.
Referenced by Begin(), and ResetFrameTracking().
|
staticprivate |
Definition at line 136 of file editor_layout.h.
Referenced by Begin(), and HasDuplicateRendering().
|
staticprivate |
Definition at line 137 of file editor_layout.h.
Referenced by Begin(), and GetDuplicatePanelName().
|
private |
Definition at line 181 of file editor_layout.h.
Referenced by Begin(), DrawFloatingIconButton(), PanelWindow(), and PanelWindow().
|
private |
Definition at line 182 of file editor_layout.h.
Referenced by Begin(), DrawFloatingIconButton(), PanelWindow(), and PanelWindow().
|
private |
Definition at line 183 of file editor_layout.h.
Referenced by Begin(), DrawFloatingIconButton(), Focus(), GetWindowName(), PanelWindow(), and PanelWindow().
|
private |
Definition at line 184 of file editor_layout.h.
Referenced by Begin(), and SetDefaultSize().
|
private |
Definition at line 185 of file editor_layout.h.
Referenced by Begin(), and SetPosition().
|
private |
Definition at line 186 of file editor_layout.h.
Referenced by SetMinimizable().
|
private |
Definition at line 187 of file editor_layout.h.
Referenced by Begin(), and SetClosable().
|
private |
Definition at line 188 of file editor_layout.h.
Referenced by IsMinimized(), and SetMinimized().
|
private |
Definition at line 189 of file editor_layout.h.
Referenced by Begin().
|
private |
Definition at line 190 of file editor_layout.h.
Referenced by End(), Focus(), and IsFocused().
|
private |
Definition at line 191 of file editor_layout.h.
Referenced by Begin(), and PanelWindow().
|
private |
Definition at line 192 of file editor_layout.h.
|
private |
Definition at line 195 of file editor_layout.h.
Referenced by Begin(), and SetHeadless().
|
private |
Definition at line 196 of file editor_layout.h.
Referenced by Begin(), and SetDockingAllowed().
|
private |
Definition at line 197 of file editor_layout.h.
Referenced by Begin(), and SetIconCollapsible().
|
private |
Definition at line 198 of file editor_layout.h.
Referenced by Begin(), and DrawFloatingIconButton().
|
private |
Definition at line 199 of file editor_layout.h.
Referenced by DrawFloatingIconButton().
|
private |
Definition at line 202 of file editor_layout.h.
Referenced by SetPinnable().
|
private |
Definition at line 203 of file editor_layout.h.
Referenced by IsPinned(), and SetPinned().
|
private |
Definition at line 204 of file editor_layout.h.
Referenced by SetPinChangedCallback().
|
private |
Definition at line 207 of file editor_layout.h.
Referenced by Begin(), and SetSaveSettings().
|
private |
Definition at line 215 of file editor_layout.h.
Referenced by AddHeaderButton().