The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
button.c File Reference

idunn: buttons in the variants of the preview (shadcn's, with the refined finish and a soft red delete button). More...

#include "idunn_internal.h"
#include <stdlib.h>
#include <string.h>

Macros

#define ICON_SIZE   16
#define PICTURE_SIZE   20
#define ICON_GAP   8
#define MARK_WIDTH   16
#define MARK_HEIGHT   3
#define TILE_ICON   24
#define TILE_PAD   10
#define TILE_GAP   6

Functions

idunn_widget_t * idunn_button (const char *text, idunn_variant_t variant, idunn_callback_t on_click, void *data)
 a button; on_click gets the button and data.
idunn_widget_t * idunn_icon_button (const char *icon, idunn_variant_t variant, idunn_callback_t on_click, void *data)
 a square button with only an icon (a Lucide name).
void idunn_button_set_icon (idunn_widget_t *button, const char *icon)
 an icon (a Lucide name) before the text.
void idunn_button_set_picture (idunn_widget_t *button, const char *picture)
 a picture in its own colours (a Tela name, an app's icon) before the text
void idunn_button_set_active (idunn_widget_t *button, bool active)
 the button is on (a task's window is active, a toggle is on): a filled look with a short accent line under it.
void idunn_button_set_pill (idunn_widget_t *button, bool pill)
 round ends: the radius is half the height
void idunn_button_set_glass (idunn_widget_t *button, bool glass)
 see-through, lighter than what is under it (over a picture)
void idunn_button_set_tile (idunn_widget_t *button, bool tile)
 a tile: the icon larger, over the text in small type (Restart, Power off)
void idunn_button_set_dim (idunn_widget_t *button, bool dim)
 the content muted (a task whose window is minimized)
void idunn_button_set_size (idunn_widget_t *button, idunn_size_t size)
void idunn_button_set_text (idunn_widget_t *button, const char *text)
void idunn_button_set_variant (idunn_widget_t *button, idunn_variant_t variant)
void idunn_button_set_align (idunn_widget_t *button, idunn_align_t align)
 where the icon and text go: IDUNN_CENTER (the default) or IDUNN_START (side bar items, menu-like lists).

Detailed Description

idunn: buttons in the variants of the preview (shadcn's, with the refined finish and a soft red delete button).

Macro Definition Documentation

◆ ICON_SIZE

#define ICON_SIZE   16

◆ PICTURE_SIZE

#define PICTURE_SIZE   20

◆ ICON_GAP

#define ICON_GAP   8

◆ MARK_WIDTH

#define MARK_WIDTH   16

◆ MARK_HEIGHT

#define MARK_HEIGHT   3

◆ TILE_ICON

#define TILE_ICON   24

◆ TILE_PAD

#define TILE_PAD   10

◆ TILE_GAP

#define TILE_GAP   6

Function Documentation

◆ idunn_button()

idunn_widget_t * idunn_button ( const char * text,
idunn_variant_t variant,
idunn_callback_t on_click,
void * data )

a button; on_click gets the button and data.

Parameters
textthe label, or NULL for an icon button.

◆ idunn_icon_button()

idunn_widget_t * idunn_icon_button ( const char * icon,
idunn_variant_t variant,
idunn_callback_t on_click,
void * data )

a square button with only an icon (a Lucide name).

◆ idunn_button_set_icon()

void idunn_button_set_icon ( idunn_widget_t * button,
const char * icon )

an icon (a Lucide name) before the text.

◆ idunn_button_set_picture()

void idunn_button_set_picture ( idunn_widget_t * button,
const char * picture )

a picture in its own colours (a Tela name, an app's icon) before the text

◆ idunn_button_set_active()

void idunn_button_set_active ( idunn_widget_t * button,
bool active )

the button is on (a task's window is active, a toggle is on): a filled look with a short accent line under it.

◆ idunn_button_set_pill()

void idunn_button_set_pill ( idunn_widget_t * button,
bool pill )

round ends: the radius is half the height

◆ idunn_button_set_glass()

void idunn_button_set_glass ( idunn_widget_t * button,
bool glass )

see-through, lighter than what is under it (over a picture)

◆ idunn_button_set_tile()

void idunn_button_set_tile ( idunn_widget_t * button,
bool tile )

a tile: the icon larger, over the text in small type (Restart, Power off)

◆ idunn_button_set_dim()

void idunn_button_set_dim ( idunn_widget_t * button,
bool dim )

the content muted (a task whose window is minimized)

◆ idunn_button_set_size()

void idunn_button_set_size ( idunn_widget_t * button,
idunn_size_t size )

◆ idunn_button_set_text()

void idunn_button_set_text ( idunn_widget_t * button,
const char * text )

◆ idunn_button_set_variant()

void idunn_button_set_variant ( idunn_widget_t * button,
idunn_variant_t variant )

◆ idunn_button_set_align()

void idunn_button_set_align ( idunn_widget_t * button,
idunn_align_t align )

where the icon and text go: IDUNN_CENTER (the default) or IDUNN_START (side bar items, menu-like lists).