yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::gui::StyledWindow Class Reference

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
 
StyledWindowoperator= (const StyledWindow &)=delete
 

Private Attributes

int color_count_
 
int var_count_
 
bool is_open_
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ StyledWindow() [1/2]

yaze::gui::StyledWindow::StyledWindow ( const char * name,
const StyledWindowConfig & config,
bool * p_open = nullptr,
ImGuiWindowFlags flags = 0 )
inline

◆ ~StyledWindow()

yaze::gui::StyledWindow::~StyledWindow ( )
inline

Definition at line 171 of file style_guard.h.

References color_count_, and var_count_.

◆ StyledWindow() [2/2]

yaze::gui::StyledWindow::StyledWindow ( const StyledWindow & )
delete

Member Function Documentation

◆ operator bool()

yaze::gui::StyledWindow::operator bool ( ) const
inlineexplicit

Definition at line 177 of file style_guard.h.

References is_open_.

◆ operator=()

StyledWindow & yaze::gui::StyledWindow::operator= ( const StyledWindow & )
delete

Member Data Documentation

◆ color_count_

int yaze::gui::StyledWindow::color_count_
private

Definition at line 183 of file style_guard.h.

Referenced by StyledWindow(), and ~StyledWindow().

◆ var_count_

int yaze::gui::StyledWindow::var_count_
private

Definition at line 184 of file style_guard.h.

Referenced by StyledWindow(), and ~StyledWindow().

◆ is_open_

bool yaze::gui::StyledWindow::is_open_
private

Definition at line 185 of file style_guard.h.

Referenced by operator bool(), and StyledWindow().


The documentation for this class was generated from the following file: