From: Hiroaki Yamamoto Date: Sun, 20 Oct 2024 08:41:53 +0000 (+0900) Subject: menu: fix the calculation for centered titles (#2251) X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=1d79e34c2bf007b8a80c77462b160776850c130a;p=proto%2Flabwc.git menu: fix the calculation for centered titles (#2251) --- diff --git a/src/menu/menu.c b/src/menu/menu.c index cde75ccc..eb58a5a0 100644 --- a/src/menu/menu.c +++ b/src/menu/menu.c @@ -150,8 +150,7 @@ menu_update_width(struct menu *menu) } if (theme->menu_title_text_justify == LAB_JUSTIFY_CENTER) { int x, y; - x = (max_width - theme->menu_item_padding_x - - item->native_width) / 2; + x = (menu->size.width - item->native_width) / 2; x = x < 0 ? 0 : x; y = (theme->menu_item_height - item->normal.buffer->height) / 2; wlr_scene_node_set_position(item->normal.text, x, y);