src/menu.c: Clamp separator width

Reported-by: @Flrian
This commit is contained in:
Consolatis 2022-09-20 02:04:57 +02:00 committed by Johan Malm
parent 87fe6878a3
commit dcedfee5d1

View file

@ -178,9 +178,10 @@ separator_create(struct menu *menu, const char *label)
theme->menu_items_bg_color)->node; theme->menu_items_bg_color)->node;
/* theme->menu_separator_width is the line-thickness (so height here) */ /* theme->menu_separator_width is the line-thickness (so height here) */
int width = MENUWIDTH - 2 * theme->menu_separator_padding_width;
menuitem->normal.text = &wlr_scene_rect_create( menuitem->normal.text = &wlr_scene_rect_create(
menuitem->normal.tree, menuitem->normal.tree,
MENUWIDTH - 2 * theme->menu_separator_padding_width, width > 0 ? width : 0,
theme->menu_separator_width, theme->menu_separator_width,
theme->menu_separator_color)->node; theme->menu_separator_color)->node;