From 3e11dc2327d70e860b3ad32db386aadd549393b3 Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Mon, 21 Nov 2022 23:08:51 +0000 Subject: Overhaul text theming. Each piece of text is now individually themable, with foreground and background colours and optionally rounded background corners. --- src/entry.h | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'src/entry.h') diff --git a/src/entry.h b/src/entry.h index 8e9d2b4..05e73ab 100644 --- a/src/entry.h +++ b/src/entry.h @@ -19,6 +19,25 @@ #define MAX_FONT_FEATURES_LENGTH 128 #define MAX_FONT_VARIATIONS_LENGTH 128 +struct directional { + int32_t top; + int32_t right; + int32_t bottom; + int32_t left; +}; + +struct text_theme { + struct color foreground_color; + struct color background_color; + struct directional padding; + uint32_t background_corner_radius; + + bool foreground_specified; + bool background_specified; + bool padding_specified; + bool radius_specified; +}; + struct entry { struct image image; struct entry_backend_harfbuzz harfbuzz; @@ -79,12 +98,16 @@ struct entry { uint32_t outline_width; struct color foreground_color; struct color background_color; - struct color placeholder_color; struct color selection_highlight_color; - struct color selection_foreground_color; - struct color selection_background_color; struct color border_color; struct color outline_color; + + struct text_theme prompt_theme; + struct text_theme input_theme; + struct text_theme placeholder_theme; + struct text_theme default_result_theme; + struct text_theme alternate_result_theme; + struct text_theme selection_theme; }; void entry_init(struct entry *entry, uint8_t *restrict buffer, uint32_t width, uint32_t height); -- cgit v1.2.3