5 Struct N_GUI_STYLE
gullradriel edited this page 2026-10-09 00:55:18 +02:00

N_GUI_STYLE

Module: GUI: allegro5 widget system with pseudo-windows

Global style holding every configurable layout constant. More...

#include "n_gui.h"

Public Attributes

Name
float tooltip_max_w
widest a tooltip bubble's text may get before it word-wraps, in pixels (0 = wrap only at the display edge).
ALLEGRO_COLOR tooltip_fg
tooltip text color
float tooltip_delay
inner padding
ALLEGRO_COLOR tooltip_border
tooltip bubble border color
ALLEGRO_COLOR tooltip_bg
tooltip bubble background color
float titlebar_h
title bar height
float title_padding
padding left of title text
float title_max_w_reserve
pixels reserved right of title for truncation
float textarea_padding
float textarea_cursor_width
cursor width in pixels
float textarea_cursor_blink_period
cursor blink period in seconds (full cycle on+off)
float tb_btn_spacing
gap between titlebar buttons
float tb_btn_size
titlebar button size (0 = auto: titlebar_h - 4)
float tb_btn_right_margin
right margin from window edge to rightmost button
float tb_btn_glyph_thickness
line thickness for titlebar button glyphs
float slider_value_label_offset
gap between slider end and value label
float slider_track_size
track width (vertical) or height (horizontal)
float slider_track_corner_r
track corner radius
float slider_track_border_thickness
track outline thickness
float slider_handle_min_r
minimum handle circle radius
float slider_handle_edge_offset
handle circle offset from edge
float slider_handle_border_thickness
handle border thickness
int shape_mode
global widget shape override: N_GUI_SHAPE_ROUNDED forces a rounded GUI, N_GUI_SHAPE_RECT forces a square one, and -1 (default) leaves each widget on its own shape (the dropmenu button + panel still default to rounded).
ALLEGRO_COLOR scrollbar_track_color
scrollbar track colour
float scrollbar_thumb_padding
thumb inset from track edge
float scrollbar_thumb_min
minimum thumb dimension
float scrollbar_thumb_corner_r
thumb corner radius
ALLEGRO_COLOR scrollbar_thumb_color
scrollbar thumb colour
float scrollbar_size
scrollbar track width/height
float scroll_step
pixels per mouse wheel notch for window auto-scroll
float radiolist_default_item_height
default item height for radiolist
float radio_label_gap
gap between circle and label text
float radio_inner_offset
inner filled circle shrink from outer
float radio_circle_min_r
minimum outer circle radius
float radio_circle_border_thickness
outer circle border thickness
float min_win_w
minimum window width (for resize)
float min_win_h
minimum window height (for resize)
float listbox_default_item_height
default item height for listbox
float link_underline_thickness
link underline thickness
ALLEGRO_COLOR link_color_normal
link colour (normal)
ALLEGRO_COLOR link_color_hover
link colour (hover)
float label_padding
horizontal padding each side
float item_text_padding
text padding inside list/combo/dropmenu items
float item_selection_inset
item highlight inset from left/right edges
float item_height_pad
min padding added to font height for item height
float grip_size
grip area size
float grip_line_thickness
grip line thickness
ALLEGRO_COLOR grip_color
grip line colour
ALLEGRO_COLOR global_scrollbar_track_color
global scrollbar track colour
float global_scrollbar_thumb_padding
global thumb inset from track edge
float global_scrollbar_thumb_min
global minimum thumb dimension
float global_scrollbar_thumb_corner_r
global thumb corner radius
ALLEGRO_COLOR global_scrollbar_thumb_color
global scrollbar thumb colour
ALLEGRO_COLOR global_scrollbar_thumb_border_color
global scrollbar thumb border colour
float global_scrollbar_size
global scrollbar track width/height
float global_scrollbar_border_thickness
global thumb border thickness
float global_scroll_step
pixels per mouse wheel notch for global scroll
int dropmenu_max_visible
default max visible items for dropmenu panel
float dropdown_border_thickness
dropdown panel border thickness
float dropdown_arrow_thickness
arrow stroke thickness
float dropdown_arrow_reserve
horizontal space reserved for the arrow on the right
float dropdown_arrow_half_w
horizontal half-extent of the arrow chevron
float dropdown_arrow_half_h
vertical half-extent of the arrow chevron
int combobox_max_visible
default max visible items for combobox dropdown
float combobox_max_dropdown_width
maximum dropdown width for N_GUI_COMBOBOX_AUTO_WIDTH (0 = display width)
float checkbox_max_size
maximum box size
float checkbox_mark_thickness
checkmark line thickness
float checkbox_mark_margin
checkmark inset from box edge
float checkbox_label_offset
horizontal offset from box edge to label text
float checkbox_label_gap
gap between box and label text

Detailed Description

struct N_GUI_STYLE;

Global style holding every configurable layout constant.

Initialised with sensible defaults by n_gui_default_style(). Can be serialised/deserialised to/from JSON with n_gui_style_to_json / n_gui_style_from_json.

Public Attributes Documentation

variable tooltip_max_w

float tooltip_max_w;

widest a tooltip bubble's text may get before it word-wraps, in pixels (0 = wrap only at the display edge).

Without a cap a long tooltip on a wide display renders as one line the width of the screen, which is readable but miserable to read; ~50 characters per line is not

variable tooltip_fg

ALLEGRO_COLOR tooltip_fg;

tooltip text color

variable tooltip_delay

float tooltip_delay;

inner padding

seconds the pointer must rest on a widget before its tooltip shows

variable tooltip_border

ALLEGRO_COLOR tooltip_border;

tooltip bubble border color

variable tooltip_bg

ALLEGRO_COLOR tooltip_bg;

tooltip bubble background color

variable titlebar_h

float titlebar_h;

title bar height

variable title_padding

float title_padding;

padding left of title text

variable title_max_w_reserve

float title_max_w_reserve;

pixels reserved right of title for truncation

variable textarea_padding

float textarea_padding;

variable textarea_cursor_width

float textarea_cursor_width;

cursor width in pixels

float textarea_cursor_blink_period;

cursor blink period in seconds (full cycle on+off)

variable tb_btn_spacing

float tb_btn_spacing;

gap between titlebar buttons

variable tb_btn_size

float tb_btn_size;

titlebar button size (0 = auto: titlebar_h - 4)

variable tb_btn_right_margin

float tb_btn_right_margin;

right margin from window edge to rightmost button

variable tb_btn_glyph_thickness

float tb_btn_glyph_thickness;

line thickness for titlebar button glyphs

variable slider_value_label_offset

float slider_value_label_offset;

gap between slider end and value label

variable slider_track_size

float slider_track_size;

track width (vertical) or height (horizontal)

variable slider_track_corner_r

float slider_track_corner_r;

track corner radius

variable slider_track_border_thickness

float slider_track_border_thickness;

track outline thickness

variable slider_handle_min_r

float slider_handle_min_r;

minimum handle circle radius

variable slider_handle_edge_offset

float slider_handle_edge_offset;

handle circle offset from edge

variable slider_handle_border_thickness

float slider_handle_border_thickness;

handle border thickness

variable shape_mode

int shape_mode;

global widget shape override: N_GUI_SHAPE_ROUNDED forces a rounded GUI, N_GUI_SHAPE_RECT forces a square one, and -1 (default) leaves each widget on its own shape (the dropmenu button + panel still default to rounded).

Buttons and comboboxes follow this when it is set. The widgets with no shape of their own (textareas, checkboxes, a frameless window's body, the combobox dropdown) round ONLY when it is N_GUI_SHAPE_ROUNDED, and stay square otherwise. Toggle with n_gui_set_shape_mode() for a round/square GUI.

variable scrollbar_track_color

ALLEGRO_COLOR scrollbar_track_color;

scrollbar track colour

variable scrollbar_thumb_padding

float scrollbar_thumb_padding;

thumb inset from track edge

variable scrollbar_thumb_min

float scrollbar_thumb_min;

minimum thumb dimension

variable scrollbar_thumb_corner_r

float scrollbar_thumb_corner_r;

thumb corner radius

variable scrollbar_thumb_color

ALLEGRO_COLOR scrollbar_thumb_color;

scrollbar thumb colour

variable scrollbar_size

float scrollbar_size;

scrollbar track width/height

variable scroll_step

float scroll_step;

pixels per mouse wheel notch for window auto-scroll

variable radiolist_default_item_height

float radiolist_default_item_height;

default item height for radiolist

variable radio_label_gap

float radio_label_gap;

gap between circle and label text

variable radio_inner_offset

float radio_inner_offset;

inner filled circle shrink from outer

variable radio_circle_min_r

float radio_circle_min_r;

minimum outer circle radius

variable radio_circle_border_thickness

float radio_circle_border_thickness;

outer circle border thickness

variable min_win_w

float min_win_w;

minimum window width (for resize)

variable min_win_h

float min_win_h;

minimum window height (for resize)

variable listbox_default_item_height

float listbox_default_item_height;

default item height for listbox

float link_underline_thickness;

link underline thickness

ALLEGRO_COLOR link_color_normal;

link colour (normal)

ALLEGRO_COLOR link_color_hover;

link colour (hover)

variable label_padding

float label_padding;

horizontal padding each side

variable item_text_padding

float item_text_padding;

text padding inside list/combo/dropmenu items

variable item_selection_inset

float item_selection_inset;

item highlight inset from left/right edges

variable item_height_pad

float item_height_pad;

min padding added to font height for item height

variable grip_size

float grip_size;

grip area size

variable grip_line_thickness

float grip_line_thickness;

grip line thickness

variable grip_color

ALLEGRO_COLOR grip_color;

grip line colour

variable global_scrollbar_track_color

ALLEGRO_COLOR global_scrollbar_track_color;

global scrollbar track colour

variable global_scrollbar_thumb_padding

float global_scrollbar_thumb_padding;

global thumb inset from track edge

variable global_scrollbar_thumb_min

float global_scrollbar_thumb_min;

global minimum thumb dimension

variable global_scrollbar_thumb_corner_r

float global_scrollbar_thumb_corner_r;

global thumb corner radius

variable global_scrollbar_thumb_color

ALLEGRO_COLOR global_scrollbar_thumb_color;

global scrollbar thumb colour

variable global_scrollbar_thumb_border_color

ALLEGRO_COLOR global_scrollbar_thumb_border_color;

global scrollbar thumb border colour

variable global_scrollbar_size

float global_scrollbar_size;

global scrollbar track width/height

variable global_scrollbar_border_thickness

float global_scrollbar_border_thickness;

global thumb border thickness

variable global_scroll_step

float global_scroll_step;

pixels per mouse wheel notch for global scroll

variable dropmenu_max_visible

int dropmenu_max_visible;

default max visible items for dropmenu panel

variable dropdown_border_thickness

float dropdown_border_thickness;

dropdown panel border thickness

variable dropdown_arrow_thickness

float dropdown_arrow_thickness;

arrow stroke thickness

variable dropdown_arrow_reserve

float dropdown_arrow_reserve;

horizontal space reserved for the arrow on the right

variable dropdown_arrow_half_w

float dropdown_arrow_half_w;

horizontal half-extent of the arrow chevron

variable dropdown_arrow_half_h

float dropdown_arrow_half_h;

vertical half-extent of the arrow chevron

variable combobox_max_visible

int combobox_max_visible;

default max visible items for combobox dropdown

variable combobox_max_dropdown_width

float combobox_max_dropdown_width;

maximum dropdown width for N_GUI_COMBOBOX_AUTO_WIDTH (0 = display width)

variable checkbox_max_size

float checkbox_max_size;

maximum box size

variable checkbox_mark_thickness

float checkbox_mark_thickness;

checkmark line thickness

variable checkbox_mark_margin

float checkbox_mark_margin;

checkmark inset from box edge

variable checkbox_label_offset

float checkbox_label_offset;

horizontal offset from box edge to label text

variable checkbox_label_gap

float checkbox_label_gap;

gap between box and label text