Vertical padding size, used for spacing out elements in the window decorations.
Default is 3.
+*menu.items.padding.x*
+ Horizontal padding of menu text entries in pixels.
+ Default is 7.
+
+*menu.items.padding.y*
+ Vertical padding of menu text entries in pixels.
+ Default is 4.
+
*menu.overlap.x*
Horizontal overlap in pixels between submenus and their parents. A
positive value move submenus over the top of their parents, whereas a
float window_inactive_button_close_unpressed_image_color[4];
/* TODO: add pressed and hover colors for buttons */
+ int menu_item_padding_x;
+ int menu_item_padding_y;
+
float menu_items_bg_color[4];
float menu_items_text_color[4];
float menu_items_active_bg_color[4];
#include "theme.h"
#define MENUWIDTH (110)
-#define MENU_ITEM_PADDING_Y (4)
-#define MENU_ITEM_PADDING_X (7)
/* state-machine variables for processing <item></item> */
static bool in_item;
if (!menu->item_height) {
menu->item_height = font_height(&rc.font_menuitem)
- + 2 * MENU_ITEM_PADDING_Y;
+ + 2 * theme->menu_item_padding_y;
}
menuitem->height = menu->item_height;
int x, y;
- int item_max_width = MENUWIDTH - 2 * MENU_ITEM_PADDING_X;
+ int item_max_width = MENUWIDTH - 2 * theme->menu_item_padding_x;
/* Menu item root node */
menuitem->tree = wlr_scene_tree_create(menu->scene_tree);
&rc.font_menuitem, theme->menu_items_active_text_color, arrow);
/* Center font nodes */
- x = MENU_ITEM_PADDING_X;
+ x = theme->menu_item_padding_x;
y = (menu->item_height - menuitem->normal.buffer->height) / 2;
wlr_scene_node_set_position(menuitem->normal.text, x, y);
y = (menu->item_height - menuitem->selected.buffer->height) / 2;
parse_hexstr("#dddad6", theme->menu_items_active_bg_color);
parse_hexstr("#000000", theme->menu_items_active_text_color);
+ theme->menu_item_padding_x = 7;
+ theme->menu_item_padding_y = 4;
+
theme->menu_separator_line_thickness = 1;
theme->menu_separator_padding_width = 6;
theme->menu_separator_padding_height = 3;
if (match(key, "padding.height")) {
theme->padding_height = atoi(value);
}
+ if (match(key, "menu.items.padding.x")) {
+ theme->menu_item_padding_x = atoi(value);
+ }
+ if (match(key, "menu.items.padding.y")) {
+ theme->menu_item_padding_y = atoi(value);
+ }
if (match(key, "menu.overlap.x")) {
theme->menu_overlap_x = atoi(value);
}