]> git.mdlowis.com Git - proto/labwc.git/commitdiff
menu: use only menu_separator_padding_width to pad separators w/o label
authorTomi Ollila <tomi.ollila@iki.fi>
Thu, 31 Oct 2024 18:26:32 +0000 (20:26 +0200)
committerJohan Malm <johanmalm@users.noreply.github.com>
Wed, 6 Nov 2024 20:40:28 +0000 (20:40 +0000)
I.e. drop the extra padding from menu_item_padding_x that got there
when separators with labels were implemented.

src/menu/menu.c

index da7289e8cbcaa07f2c840c91e47d084a7a1d66fe..7d08aa41d94c097c14ca1353d74014d9a882f3d3 100644 (file)
@@ -138,8 +138,7 @@ menu_update_width(struct menu *menu)
                 */
                if (item->type == LAB_MENU_SEPARATOR_LINE) {
                        int width = menu->size.width
-                               - 2 * theme->menu_separator_padding_width
-                               - 2 * theme->menu_item_padding_x;
+                               - 2 * theme->menu_separator_padding_width;
                        wlr_scene_rect_set_size(
                                wlr_scene_rect_from_node(item->normal.text),
                                width, theme->menu_separator_line_thickness);
@@ -360,8 +359,7 @@ separator_create(struct menu *menu, const char *label)
                wlr_scene_node_set_position(&menuitem->tree->node, 0, menu->size.height);
                /* Vertically center-align separator line */
                wlr_scene_node_set_position(menuitem->normal.text,
-                       theme->menu_separator_padding_width
-                       + theme->menu_item_padding_x,
+                       theme->menu_separator_padding_width,
                        theme->menu_separator_padding_height);
        }
        wlr_scene_node_set_position(&menuitem->tree->node, 0, menu->size.height);