fixes more or less

This commit is contained in:
Patrick 2025-10-08 18:22:43 +02:00
commit 74c5f7a004
7 changed files with 67 additions and 63 deletions

View file

@ -28,9 +28,10 @@ typedef enum PGPL_GuiStatusColor {
/* This controls what font size from the theme should be used. There are three
* different types. */
typedef enum PGPL_GuiFontSize {
PGPL_GUI_FONT_SIZE_TITLE,
PGPL_GUI_FONT_SIZE_HEADING,
PGPL_GUI_FONT_SIZE_CONTENT
PGPL_GUI_FONT_SIZE_CONTENT,
PGPL_GUI_FONT_SIZE_HEADING_SMALL,
PGPL_GUI_FONT_SIZE_HEADING_LARGE,
PGPL_GUI_FONT_SIZE_TITLE
} PGPL_GuiFontSize;
/* This is the struct for the themes. This controls the colors, font sizes, font
@ -54,7 +55,7 @@ typedef struct PGPL_GuiTheme {
PGPL_Rectangle padding;
/* Controls the font size of the widgets, this is an array of three so that it
* can support all values from PGPL_GuiFontSize. */
double font_size[3];
double font_size[4];
/* The font of the theme. */
PGPL_Font *font;
} PGPL_GuiTheme;

View file

@ -91,11 +91,9 @@ void pgpl_gui_empty_widget_destroy(PGPL_GuiWidget *empty_widget);
/* This is the struct for a slider widget. The inversed option inverses its
* slide direction, vertical determines if it's vertical or horizontal. The
* bar_height is the height of the slider bar. The slide_callback gets called
* whenever there is sliding activity. */
* slide_callback gets called whenever there is sliding activity. */
typedef struct PGPL_GuiSliderWidget {
PGPL_GuiWidget parent;
uint32_t bar_height;
bool inversed;
bool vertical;
double current_value;
@ -107,7 +105,7 @@ typedef struct PGPL_GuiSliderWidget {
/* This creates a new slider with the given properties. */
PGPL_GuiSliderWidget *pgpl_gui_slider_widget_create(
uint32_t bar_height, bool inversed, bool vertical, double value,
bool inversed, bool vertical, double value,
void (*slide_callback)(void *app_data, double value));
/* This destorys a slider widget. */

View file

@ -43,9 +43,9 @@ static inline uint8_t pgpl_color_get_alpha(PGPL_Color color) {
/* Divides all color values by the given amount. */
static inline PGPL_Color pgpl_color_divide(PGPL_Color color, double divisor) {
return pgpl_color_create(pgpl_color_get_red(color) / divisor,
pgpl_color_get_green(color) / divisor,
pgpl_color_get_blue(color) / divisor,
return pgpl_color_create((uint8_t)(pgpl_color_get_red(color) / divisor),
(uint8_t)(pgpl_color_get_green(color) / divisor),
(uint8_t)(pgpl_color_get_blue(color) / divisor),
pgpl_color_get_alpha(color));
}