mirror of
https://codeberg.org/adnano/wmenu.git
synced 2025-11-01 22:58:43 -04:00
Add wmenu -H flag
This flag allows the user to specify the line height usually in terms of pixels.
This commit is contained in:
parent
fc69aa6e2b
commit
3725c6fadc
4 changed files with 21 additions and 7 deletions
7
render.c
7
render.c
|
|
@ -107,12 +107,13 @@ static void render_input(struct menu *menu, cairo_t *cairo) {
|
|||
static void render_cursor(struct menu *menu, cairo_t *cairo) {
|
||||
const int cursor_width = 2;
|
||||
const int cursor_margin = 2;
|
||||
int cursor_pos = menu->promptw + menu->padding
|
||||
int cursor_x_pos = menu->promptw + menu->padding
|
||||
+ text_width(cairo, menu->font, menu->input)
|
||||
- text_width(cairo, menu->font, &menu->input[menu->cursor])
|
||||
- cursor_width / 2;
|
||||
cairo_rectangle(cairo, cursor_pos, cursor_margin, cursor_width,
|
||||
menu->line_height - 2 * cursor_margin);
|
||||
int cursor_y_pos = (menu->line_height - menu->font_height) / 2 + cursor_margin;
|
||||
cairo_rectangle(cairo, cursor_x_pos, cursor_y_pos, cursor_width,
|
||||
menu->font_height - cursor_margin);
|
||||
cairo_fill(cairo);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue