Zrythm
a highly automated and intuitive digital audio workstation
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
CustomButtonWidget Struct Reference

Custom button to be drawn inside drawing areas. More...

#include <gui/widgets/custom_button.h>

Data Fields

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 [120]
 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.
 
GdkTexture * icon_texture
 Object to pass to the callback.
 
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.
 
int text_height
 
PangoLayout * layout
 Cache layout for drawing the text.
 
double x
 X/y relative to parent drawing area.
 
double y
 
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.
 

Detailed Description

Custom button to be drawn inside drawing areas.

Definition at line 44 of file custom_button.h.

Field Documentation

◆ aspect

double CustomButtonWidget::aspect

Whether currently hovered.

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

Definition at line 84 of file custom_button.h.

◆ button_id

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

Definition at line 131 of file custom_button.h.

◆ corner_radius

double CustomButtonWidget::corner_radius

Corner curvature radius for the rounded rectangle.

Definition at line 88 of file custom_button.h.

◆ def_color

GdkRGBA CustomButtonWidget::def_color

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

Whether the button is a toggle. Default color.

Definition at line 54 of file custom_button.h.

◆ held_color

GdkRGBA CustomButtonWidget::held_color

Held color (used after clicking and before releasing).

Definition at line 64 of file custom_button.h.

◆ hovered_color

GdkRGBA CustomButtonWidget::hovered_color

Hovered color.

Definition at line 57 of file custom_button.h.

◆ icon_name

char CustomButtonWidget::icon_name[120]

Name of the icon to show.

Definition at line 67 of file custom_button.h.

◆ icon_texture

GdkTexture* CustomButtonWidget::icon_texture

Object to pass to the callback.

The icon surface.

Definition at line 94 of file custom_button.h.

◆ last_color

GdkRGBA CustomButtonWidget::last_color

Used during transitions.

Definition at line 106 of file custom_button.h.

◆ last_state

CustomButtonWidgetState CustomButtonWidget::last_state

Used to update caches if state changed.

Definition at line 97 of file custom_button.h.

◆ layout

PangoLayout* CustomButtonWidget::layout

Cache layout for drawing the text.

Definition at line 118 of file custom_button.h.

◆ owner

void* CustomButtonWidget::owner

Owner.

Definition at line 103 of file custom_button.h.

◆ owner_type

CustomButtonWidgetOwner CustomButtonWidget::owner_type

Owner type.

Definition at line 100 of file custom_button.h.

◆ size

int CustomButtonWidget::size

Size in pixels (width and height will be set to this).

Definition at line 71 of file custom_button.h.

◆ text

char* CustomButtonWidget::text

Text, if any, to show after the icon.

This will be ellipsized.

Definition at line 113 of file custom_button.h.

◆ text_height

int CustomButtonWidget::text_height

Definition at line 115 of file custom_button.h.

◆ toggled_color

GdkRGBA CustomButtonWidget::toggled_color

Toggled color.

Definition at line 60 of file custom_button.h.

◆ transition_frames

int CustomButtonWidget::transition_frames

Frames left for a transition in color.

Definition at line 134 of file custom_button.h.

◆ width

int CustomButtonWidget::width

if non-zero, the button has "size" height and this width.

Definition at line 75 of file custom_button.h.

◆ x

double CustomButtonWidget::x

X/y relative to parent drawing area.

Definition at line 121 of file custom_button.h.

◆ y

double CustomButtonWidget::y

Definition at line 122 of file custom_button.h.


The documentation for this struct was generated from the following file: