CustomButtonWidget struct

Custom button to be drawn inside drawing areas.

Contents

Public variables

GdkRGBA def_color
Function to call on press (after click and release).
GdkRGBA hovered_color
Hovered color.
GdkRGBA toggled_color
Toggled color.
GdkRGBA held_color
Held color (used after clicking and before releasing).
char icon_name
Name of the icon to show.
int size
Size in pixels (width and height will be set to this).
int width
if non-zero, the button has "size" height and this width.
double aspect
Whether currently hovered.
double corner_radius
Corner curvature radius for the rounded rectangle.
cairo_surface_t* icon_surface
Object to pass to the callback.
cairo_t* cached_cr
Cairo caches.
CustomButtonWidgetState last_state
Used to update caches if state changed.
CustomButtonWidgetOwner owner_type
Owner type.
void* owner
Owner.
GdkRGBA last_color
Used during transitions.
char* text
Text, if any, to show after the icon.
PangoLayout* layout
Cache layout for drawing the text.
double x
X/y relative to parent drawing area.
unsigned int button_id
The id of the button returned by a symap of its icon name, for better performance vs comparing strings.
int transition_frames
Frames left for a transition in color.

Variable documentation

GdkRGBA CustomButtonWidget::def_color

Function to call on press (after click and release).

Whether the button is a toggle. Default color.

double CustomButtonWidget::aspect

Whether currently hovered.

Whether currently held down. Aspect ratio for the rounded rectangle.

cairo_surface_t* CustomButtonWidget::icon_surface

Object to pass to the callback.

The icon surface.

char* CustomButtonWidget::text

Text, if any, to show after the icon.

This will be ellipsized.

unsigned int CustomButtonWidget::button_id

The id of the button returned by a symap of its icon name, for better performance vs comparing strings.

TODO