diff options
| author | Jack Jamison <jackqjamison@gmail.com> | 2025-11-09 02:18:03 -0500 |
|---|---|---|
| committer | Jack Jamison <jackqjamison@gmail.com> | 2025-11-09 02:18:03 -0500 |
| commit | c078f5275f27a8812301a7d9c795ab4284d69bd3 (patch) | |
| tree | 6245399e52c1c01c0a6630db3a8739581df01f12 /layer_surface.c | |
| parent | d0b1b2db2210d4fe31701d144d03a37ea55ece00 (diff) | |
improve prompt layout
Diffstat (limited to 'layer_surface.c')
| -rw-r--r-- | layer_surface.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/layer_surface.c b/layer_surface.c index c1d7caa..ce41ac5 100644 --- a/layer_surface.c +++ b/layer_surface.c @@ -1,6 +1,8 @@ #include "./state.h" #include "config.h" +#include "font.h" + struct zwlr_layer_surface_v1_listener layer_surface_listener; void create_surface(client_state* state) { @@ -17,6 +19,9 @@ void create_surface(client_state* state) { uint32_t desired_height = state->line_height; if (state->center) { desired_width = MAX(state->required_width, config.min_width); + if (!state->lines) { + desired_width += state->prompt ? atlas_get_strwidth(state, state->prompt) + state->horizontal_spacing : 0.0f; + } } if (state->lines) { desired_height = (state->lines + 1) * state->line_height; |
