Ultra-compact toolbar that merges mode buttons with settings. More...
#include <editor_layout.h>
Public Member Functions | |
Toolset ()=default | |
void | Begin () |
void | End () |
void | BeginModeGroup () |
bool | ModeButton (const char *icon, bool selected, const char *tooltip) |
void | EndModeGroup () |
void | AddSeparator () |
void | AddRomBadge (uint8_t version, std::function< void()> on_upgrade=nullptr) |
bool | AddProperty (const char *icon, const char *label, uint8_t *value, std::function< void()> on_change=nullptr) |
bool | AddProperty (const char *icon, const char *label, uint16_t *value, std::function< void()> on_change=nullptr) |
bool | AddCombo (const char *icon, int *current, const char *const items[], int count) |
bool | AddToggle (const char *icon, bool *state, const char *tooltip) |
bool | AddAction (const char *icon, const char *tooltip) |
bool | BeginCollapsibleSection (const char *label, bool *p_open) |
void | EndCollapsibleSection () |
void | AddV3StatusBadge (uint8_t version, std::function< void()> on_settings) |
bool | AddUsageStatsButton (const char *tooltip) |
int | GetButtonCount () const |
Private Attributes | |
bool | in_toolbar_ = false |
bool | in_section_ = false |
int | button_count_ = 0 |
float | current_line_width_ = 0.0f |
float | mode_group_button_size_ = 0.0f |
Ultra-compact toolbar that merges mode buttons with settings.
Design Philosophy:
Layout: [Mode Icons] | [ROM Badge] [World] [GFX] [Pal] [Spr] ... | [Quick Actions]
Definition at line 26 of file editor_layout.h.
|
default |
void yaze::gui::Toolset::Begin | ( | ) |
Definition at line 21 of file editor_layout.cc.
References button_count_, current_line_width_, and in_toolbar_.
Referenced by yaze::gui::EditorLayout::Begin(), yaze::editor::AssemblyEditor::DrawToolset(), yaze::editor::DungeonEditorV2::DrawToolset(), yaze::editor::GraphicsEditor::DrawToolset(), yaze::editor::ScreenEditor::DrawToolset(), yaze::editor::OverworldEditor::DrawToolset(), and yaze::editor::SpriteEditor::DrawToolset().
void yaze::gui::Toolset::End | ( | ) |
Definition at line 34 of file editor_layout.cc.
References current_line_width_, and in_toolbar_.
Referenced by yaze::editor::AssemblyEditor::DrawToolset(), yaze::editor::DungeonEditorV2::DrawToolset(), yaze::editor::GraphicsEditor::DrawToolset(), yaze::editor::ScreenEditor::DrawToolset(), yaze::editor::OverworldEditor::DrawToolset(), yaze::editor::SpriteEditor::DrawToolset(), and yaze::gui::EditorLayout::End().
void yaze::gui::Toolset::BeginModeGroup | ( | ) |
Definition at line 44 of file editor_layout.cc.
References mode_group_button_size_.
Referenced by yaze::editor::OverworldEditor::DrawToolset().
bool yaze::gui::Toolset::ModeButton | ( | const char * | icon, |
bool | selected, | ||
const char * | tooltip | ||
) |
Definition at line 67 of file editor_layout.cc.
References button_count_, yaze::gui::GetAccentColor(), and mode_group_button_size_.
Referenced by yaze::editor::OverworldEditor::DrawToolset().
void yaze::gui::Toolset::EndModeGroup | ( | ) |
Definition at line 90 of file editor_layout.cc.
References AddSeparator().
Referenced by yaze::editor::OverworldEditor::DrawToolset().
void yaze::gui::Toolset::AddSeparator | ( | ) |
Definition at line 97 of file editor_layout.cc.
Referenced by yaze::editor::DungeonEditorV2::DrawToolset(), yaze::editor::OverworldEditor::DrawToolset(), and EndModeGroup().
void yaze::gui::Toolset::AddRomBadge | ( | uint8_t | version, |
std::function< void()> | on_upgrade = nullptr |
||
) |
Definition at line 103 of file editor_layout.cc.
References ICON_MD_UPGRADE, and yaze::gui::RomVersionBadge().
Referenced by yaze::editor::OverworldEditor::DrawToolset().
bool yaze::gui::Toolset::AddProperty | ( | const char * | icon, |
const char * | label, | ||
uint8_t * | value, | ||
std::function< void()> | on_change = nullptr |
||
) |
Definition at line 121 of file editor_layout.cc.
References yaze::gui::InputHexByte().
Referenced by yaze::editor::OverworldEditor::DrawToolset().
bool yaze::gui::Toolset::AddProperty | ( | const char * | icon, |
const char * | label, | ||
uint16_t * | value, | ||
std::function< void()> | on_change = nullptr |
||
) |
Definition at line 137 of file editor_layout.cc.
References yaze::gui::InputHexWord().
bool yaze::gui::Toolset::AddCombo | ( | const char * | icon, |
int * | current, | ||
const char *const | items[], | ||
int | count | ||
) |
Definition at line 153 of file editor_layout.cc.
bool yaze::gui::Toolset::AddToggle | ( | const char * | icon, |
bool * | state, | ||
const char * | tooltip | ||
) |
Definition at line 165 of file editor_layout.cc.
References yaze::gui::ToggleIconButton().
Referenced by yaze::editor::DungeonEditorV2::DrawToolset(), and yaze::editor::OverworldEditor::DrawToolset().
bool yaze::gui::Toolset::AddAction | ( | const char * | icon, |
const char * | tooltip | ||
) |
Definition at line 171 of file editor_layout.cc.
References yaze::gui::WidgetIdRegistry::Instance(), and yaze::gui::WidgetIdRegistry::RegisterWidget().
Referenced by yaze::editor::AssemblyEditor::DrawToolset(), yaze::editor::DungeonEditorV2::DrawToolset(), yaze::editor::GraphicsEditor::DrawToolset(), yaze::editor::ScreenEditor::DrawToolset(), yaze::editor::OverworldEditor::DrawToolset(), and yaze::editor::SpriteEditor::DrawToolset().
bool yaze::gui::Toolset::BeginCollapsibleSection | ( | const char * | label, |
bool * | p_open | ||
) |
Definition at line 189 of file editor_layout.cc.
References in_section_.
void yaze::gui::Toolset::EndCollapsibleSection | ( | ) |
Definition at line 197 of file editor_layout.cc.
References in_section_.
void yaze::gui::Toolset::AddV3StatusBadge | ( | uint8_t | version, |
std::function< void()> | on_settings | ||
) |
Definition at line 201 of file editor_layout.cc.
References yaze::gui::Default, ICON_MD_TUNE, ICON_MD_UPGRADE, yaze::gui::StatusBadge(), and yaze::gui::Success.
bool yaze::gui::Toolset::AddUsageStatsButton | ( | const char * | tooltip | ) |
Definition at line 218 of file editor_layout.cc.
References ICON_MD_ANALYTICS.
Referenced by yaze::editor::OverworldEditor::DrawToolset().
|
inline |
Definition at line 73 of file editor_layout.h.
References button_count_.
|
private |
Definition at line 76 of file editor_layout.h.
|
private |
Definition at line 77 of file editor_layout.h.
Referenced by BeginCollapsibleSection(), and EndCollapsibleSection().
|
private |
Definition at line 78 of file editor_layout.h.
Referenced by Begin(), GetButtonCount(), and ModeButton().
|
private |
Definition at line 79 of file editor_layout.h.
|
private |
Definition at line 80 of file editor_layout.h.
Referenced by BeginModeGroup(), and ModeButton().