ButtonStyleOptions Class Reference

#include <Pt/Forms/ButtonStyle.h>

Stores the widget-local style overrides for a push button. More...

Public Member Functions

 ButtonStyleOptions ()
 Constructs empty local button style options.
 
bool hasOverrides () const
 Returns true if any local style override is present.
 
std::size_t generation () const
 Returns the current local override generation. More...
 
const Gfx::Brushforeground () const
 Returns the local foreground override or 0 if none is set.
 
void setForeground (const Gfx::Brush &brush)
 Sets the local foreground override.
 
const Gfx::Pencontour () const
 Returns the local contour override or 0 if none is set.
 
void setContour (const Gfx::Pen &pen)
 Sets the local contour override.
 
const Gfx::ColoraccentColor () const
 Returns the local accent color override or 0 if none is set.
 
void setAccentColor (const Gfx::Color &color)
 Sets the local accent color override.
 
const Gfx::ColorhighlightColor () const
 Returns the local highlight color override or 0 if none is set.
 
void setHighlightColor (const Gfx::Color &color)
 Sets the local highlight color override.
 
const Gfx::ColortextColor () const
 Returns the local text color override or 0 if none is set.
 
void setTextColor (const Gfx::Color &color)
 Sets the local text color override.
 
const Gfx::Fontfont () const
 Returns the local font override data or 0 if none is set.
 
void setFont (const Gfx::Font &font)
 Sets the complete local font override.
 
void setFontSize (std::size_t size)
 Sets the local font size override.
 
void setFontWeight (Gfx::Font::Weight weight)
 Sets the local font weight override.
 
void setFontSlant (Gfx::Font::Slant slant)
 Sets the local font slant override.
 
Gfx::Font getFont (const Gfx::Font &base) const
 Resolves the effective font against the given style default.
 

Detailed Description

Carries optional local tokens that are resolved during the prepare step. Render and icon hooks never receive these overrides directly.

Member Function Documentation

◆ generation()

std::size_t generation ( ) const

The generation changes whenever any local override token is modified and can be used to detect when renderer preparation must be refreshed.