diff options
| author | Jack Jamison <jackqjamison@gmail.com> | 2025-10-23 22:09:44 -0400 |
|---|---|---|
| committer | Jack Jamison <jackqjamison@gmail.com> | 2025-10-23 22:09:44 -0400 |
| commit | a58e1bd66da70898144029ea3aef5d0692c37414 (patch) | |
| tree | 21a46b129d12d006416c7967e438a6d430ee205d | |
| parent | 6933f5438f303cd90346ae779af141f910a4a1b1 (diff) | |
better centering
| -rw-r--r-- | README.md | 4 | ||||
| -rw-r--r-- | graphics.c | 1 | ||||
| -rw-r--r-- | state.h | 17 |
3 files changed, 12 insertions, 10 deletions
@@ -13,12 +13,12 @@ make - [X] special mode if there is no stdin - [x] sort filtering by match % - [x] cursor +- [x] protocol clipboard - [ ] page scroll -- [ ] unicode - [ ] emacs keybindings -- [ ] protocol clipboard - [ ] fuzzy filter - [ ] "prompt" +- [ ] unicode - [ ] config file - [ ] input fluff - [ ] kerning @@ -371,6 +371,7 @@ void init_text_buffer(client_state* state, text_buffer_t* buffer, char* text, si // go forward pen_x += m->advance_x; buffer->pixel_len += ceil(m->advance_x); + if (n == 0) buffer->pixel_len += ceil(m->advance_x); // add a second if we are the first to equal padding on the right } // vertex buffer @@ -67,6 +67,8 @@ typedef struct { struct wl_pointer* pointer; struct wp_cursor_shape_manager_v1* cursor_shape_manager; struct wp_cursor_shape_device_v1* cursor_shape_device; + char* clipboard; + size_t clipboard_size; // xkb struct xkb_context* xkb_context; @@ -96,8 +98,6 @@ typedef struct { GLuint b_color_uniform; text_buffer_t input_buffer_grafix; - size_t cursor_index; - // fonts FT_Library ft_library; FT_Face ft_face; @@ -114,17 +114,18 @@ typedef struct { bool center; bool verbose; + // input + item_t* items; + // state + bool running; + int exit_code; uint32_t width, height; - char* clipboard; - size_t clipboard_size; - char* input_buffer; - item_t* items; item_display_t* filtered_items; int selected_filtered_item; + char* input_buffer; + size_t cursor_index; float scroll; - bool running; - int exit_code; } client_state; |
