]> git.mdlowis.com Git - proto/labwc.git/commitdiff
menu: fix the calculation for centered titles (#2251)
authorHiroaki Yamamoto <hrak1529@gmail.com>
Sun, 20 Oct 2024 08:41:53 +0000 (17:41 +0900)
committerGitHub <noreply@github.com>
Sun, 20 Oct 2024 08:41:53 +0000 (09:41 +0100)
src/menu/menu.c

index cde75ccc5ca13d9db4e9ed81c05a88e02fe139b4..eb58a5a0ee328eca24588703422217d9b641bd20 100644 (file)
@@ -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);