RAII compound guard for window-level style setup. More...
#include <style_guard.h>
Public Member Functions | |
| StyledWindow (const char *name, const StyledWindowConfig &config, bool *p_open=nullptr, ImGuiWindowFlags flags=0) | |
| ~StyledWindow () | |
| operator bool () const | |
| StyledWindow (const StyledWindow &)=delete | |
| StyledWindow & | operator= (const StyledWindow &)=delete |
Private Attributes | |
| int | color_count_ |
| int | var_count_ |
| bool | is_open_ |
RAII compound guard for window-level style setup.
Replaces the extremely common pattern of 2-3 PushStyleColor + 2-3 PushStyleVar + Begin/End + manual Pop counting.
Usage: StyledWindow bar("##ActivityBar", {.bg = bg, .padding = {0, 8}}, nullptr, flags); if (bar) { // draw contents }
Definition at line 135 of file style_guard.h.
|
inline |
Definition at line 137 of file style_guard.h.
References yaze::gui::StyledWindowConfig::bg, yaze::gui::StyledWindowConfig::border, yaze::gui::StyledWindowConfig::border_size, color_count_, is_open_, yaze::gui::StyledWindowConfig::padding, yaze::gui::StyledWindowConfig::rounding, yaze::gui::StyledWindowConfig::spacing, and var_count_.
|
inline |
Definition at line 171 of file style_guard.h.
References color_count_, and var_count_.
|
delete |
|
inlineexplicit |
Definition at line 177 of file style_guard.h.
References is_open_.
|
delete |
|
private |
Definition at line 183 of file style_guard.h.
Referenced by StyledWindow(), and ~StyledWindow().
|
private |
Definition at line 184 of file style_guard.h.
Referenced by StyledWindow(), and ~StyledWindow().
|
private |
Definition at line 185 of file style_guard.h.
Referenced by operator bool(), and StyledWindow().