summaryrefslogtreecommitdiff
path: root/src/entry.c
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2023-02-26 11:55:05 +0000
committerPhil Jones <philj56@gmail.com>2023-02-26 11:55:05 +0000
commit57d3a301b09c531972de4d012faafdc402f7b2d0 (patch)
tree3a3a49006b6748019b3761aeb146f9361c0007aa /src/entry.c
parent68ac60509f11d3a449a317a8d9c092ac49763451 (diff)
Pad just enough when -1 is specified.
This allows rounded background corners to work when a padding of -1 is specified.
Diffstat (limited to 'src/entry.c')
-rw-r--r--src/entry.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/entry.c b/src/entry.c
index 5ccdb72..6a55741 100644
--- a/src/entry.c
+++ b/src/entry.c
@@ -43,22 +43,6 @@ static void apply_text_theme_fallback(struct text_theme *theme, const struct tex
}
}
-static void fixup_padding_sizes(struct directional *padding, uint32_t clip_width, uint32_t clip_height)
-{
- if (padding->top < 0) {
- padding->top = clip_height;
- }
- if (padding->bottom < 0) {
- padding->bottom = clip_height;
- }
- if (padding->left < 0) {
- padding->left = clip_width;
- }
- if (padding->right < 0) {
- padding->right = clip_width;
- }
-}
-
void entry_init(struct entry *entry, uint8_t *restrict buffer, uint32_t width, uint32_t height, uint32_t scale)
{
entry->image.width = width;
@@ -204,13 +188,6 @@ void entry_init(struct entry *entry, uint8_t *restrict buffer, uint32_t width, u
apply_text_theme_fallback(&entry->alternate_result_theme, &entry->default_result_theme);
apply_text_theme_fallback(&entry->selection_theme, &default_theme);
- fixup_padding_sizes(&entry->prompt_theme.padding, width, height);
- fixup_padding_sizes(&entry->input_theme.padding, width, height);
- fixup_padding_sizes(&entry->placeholder_theme.padding, width, height);
- fixup_padding_sizes(&entry->default_result_theme.padding, width, height);
- fixup_padding_sizes(&entry->alternate_result_theme.padding, width, height);
- fixup_padding_sizes(&entry->selection_theme.padding, width, height);
-
/* The cursor is a special case, as it just needs the input colours. */
if (!entry->cursor_theme.color_specified) {
entry->cursor_theme.color = entry->input_theme.foreground_color;