mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
menu: fix the calculation for centered titles (#2251)
This commit is contained in:
parent
c237ffa667
commit
1d79e34c2b
1 changed files with 1 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue