std1.0.0-beta-7 SafeC docs

std :: gui::gui_widget

Struct std::GuiTheme

#include <std/gui/gui_widget.h> source

struct GuiTheme {
    int dark;
    struct GuiColor window;
    struct GuiColor panel;
    struct GuiColor text;
    struct GuiColor textDim;
    struct GuiColor textDisabled;
    struct GuiColor accent;
    struct GuiColor accentText;
    struct GuiColor button;
    struct GuiColor buttonHover;
    struct GuiColor buttonPressed;
    struct GuiColor input;
    struct GuiColor border;
    struct GuiColor borderStrong;
    struct GuiColor selection;
    struct GuiColor selectionText;
    struct GuiColor hover;
    struct GuiColor header;
    struct GuiColor altRow;
    struct GuiColor scrollbar;
    struct GuiColor scrollbarHover;
    struct GuiColor tooltip;
    struct GuiColor tooltipText;
    struct GuiColor shadow;
    struct GuiColor overlay;
    float fontSize;
    float smallFontSize;
    float radius;
    float borderWidth;
    int padding;
    int spacing;
    int controlHeight;
    int rowHeight;
    int scrollbarSize;
    const ?&GuiTypeface font;
    const ?&GuiTypeface boldFont;
}

Colors, fonts and metrics every built-in widget paints with. Metrics are logical units (scaled by the window's scale factor). Start from light() or dark() and change fields; GuiUi::set_theme() applies one.

Fields

§int darksource
§struct GuiColor windowsource

window background

§struct GuiColor panelsource

group boxes, tab pages, menus' background

§struct GuiColor textsource
§struct GuiColor textDimsource

placeholders, secondary text

§struct GuiColor textDisabledsource
§struct GuiColor accentsource

selection, checked controls, focus ring

§struct GuiColor accentTextsource

text on the accent color

§struct GuiColor buttonsource
§struct GuiColor buttonHoversource
§struct GuiColor buttonPressedsource
§struct GuiColor inputsource

text field / list background

§struct GuiColor bordersource
§struct GuiColor borderStrongsource

hovered / focused borders

§struct GuiColor selectionsource

selected list rows, selected text

§struct GuiColor selectionTextsource
§struct GuiColor hoversource

hovered rows and menu items

§struct GuiColor headersource

table headers, menu bar

§struct GuiColor altRowsource

every other row in tables

§struct GuiColor scrollbarsource
§struct GuiColor scrollbarHoversource
§struct GuiColor tooltipsource
§struct GuiColor tooltipTextsource
§struct GuiColor shadowsource
§struct GuiColor overlaysource

dims the window behind a modal dialog

§float fontSizesource
§float smallFontSizesource
§float radiussource

corner radius of controls

§float borderWidthsource
§int paddingsource

inside controls

§int spacingsource

between children of boxes

§int controlHeightsource

buttons, inputs, combo boxes

§int rowHeightsource

list/tree/table rows, menu items

§int scrollbarSizesource
§const ?&GuiTypeface fontsource

light()/dark() pick the system's sans-serif (GuiTypeface::system); set these to GuiTypeface::fallback() for output that doesn't depend on the installed fonts (tests, golden images).

null: GuiTypeface::fallback()

§const ?&GuiTypeface boldFontsource

null: font

Methods

§static struct GuiTheme light()source · definition
§static struct GuiTheme dark()source · definition
§static struct GuiTheme system()source · definition

The theme matching the system's dark-mode setting where it can be read ($SAFEC_GUI_THEME=dark|light overrides), else light().