theme: Rename separator_width to separator_line_thickness

This commit is contained in:
Consolatis 2022-12-06 12:01:44 +01:00 committed by Johan Malm
parent ccf68c5950
commit 3da7cfd8c6
3 changed files with 5 additions and 6 deletions

View file

@ -50,7 +50,7 @@ struct theme {
float menu_items_active_bg_color[4];
float menu_items_active_text_color[4];
int menu_separator_width;
int menu_separator_line_thickness;
int menu_separator_padding_width;
int menu_separator_padding_height;
float menu_separator_color[4];

View file

@ -166,7 +166,7 @@ separator_create(struct menu *menu, const char *label)
menuitem->selectable = false;
struct server *server = menu->server;
struct theme *theme = server->theme;
menuitem->height = theme->menu_separator_width +
menuitem->height = theme->menu_separator_line_thickness +
2 * theme->menu_separator_padding_height;
menuitem->tree = wlr_scene_tree_create(menu->scene_tree);
@ -178,12 +178,11 @@ separator_create(struct menu *menu, const char *label)
MENUWIDTH, menuitem->height,
theme->menu_items_bg_color)->node;
/* 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.tree,
width > 0 ? width : 0,
theme->menu_separator_width,
theme->menu_separator_line_thickness,
theme->menu_separator_color)->node;
wlr_scene_node_set_position(&menuitem->tree->node, 0, menu->size.height);

View file

@ -128,7 +128,7 @@ theme_builtin(struct theme *theme)
parse_hexstr("#dddad6", theme->menu_items_active_bg_color);
parse_hexstr("#000000", theme->menu_items_active_text_color);
theme->menu_separator_width = 1;
theme->menu_separator_line_thickness = 1;
theme->menu_separator_padding_width = 6;
theme->menu_separator_padding_height = 3;
parse_hexstr("#888888", theme->menu_separator_color);
@ -265,7 +265,7 @@ entry(struct theme *theme, const char *key, const char *value)
}
if (match(key, "menu.separator.width")) {
theme->menu_separator_width = atoi(value);
theme->menu_separator_line_thickness = atoi(value);
}
if (match(key, "menu.separator.padding.width")) {
theme->menu_separator_padding_width = atoi(value);