psychic-ui 0.0.0
Loading...
Searching...
No Matches
psychic_ui::StyleDeclaration Class Reference

#include <StyleDeclaration.hpp>

Public Member Functions

 StyleDeclaration (std::string selectorString, std::unique_ptr< StyleSelector > selector, Style::ChangedCallback onChanged=nullptr, void *owner=nullptr)
const std::string & selectorString () const
const StyleSelector * selector () const
Style & style ()
const Style & style () const
int weight () const
bool active () const
void setActive (bool active)

Protected Attributes

const std::string _selectorString
const std::unique_ptr< StyleSelector > _selector
Style _style
int _weight {0}
bool _active {false}

Detailed Description

A stylesheet rule: a selector and the style it applies

Member Function Documentation

◆ active()

bool psychic_ui::StyleDeclaration::active ( ) const
inlinenodiscard

Whether the rule is in effect: false once its style manager was reset, until it is declared again

◆ weight()

int psychic_ui::StyleDeclaration::weight ( ) const
inlinenodiscard

Returns the cached weight computed from the selector chain

Returns
int

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