summaryrefslogtreecommitdiff
path: root/src/entry.h
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2022-11-21 23:08:51 +0000
committerPhil Jones <philj56@gmail.com>2022-11-21 23:53:25 +0000
commit3e11dc2327d70e860b3ad32db386aadd549393b3 (patch)
treea9768d3c65dd3df77be7ae8530f76fa07a5c9c42 /src/entry.h
parentc43e1611437bcb450526f5624712dcde8d061245 (diff)
Overhaul text theming.
Each piece of text is now individually themable, with foreground and background colours and optionally rounded background corners.
Diffstat (limited to 'src/entry.h')
-rw-r--r--src/entry.h29
1 files changed, 26 insertions, 3 deletions
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);