]> git.mdlowis.com Git - proto/labwc.git/commitdiff
theme: rename menu_item_padding to menu_items_padding
authortokyo4j <hrak1529@gmail.com>
Tue, 12 Nov 2024 03:36:21 +0000 (12:36 +0900)
committerJohan Malm <johanmalm@users.noreply.github.com>
Tue, 12 Nov 2024 17:25:39 +0000 (17:25 +0000)
include/theme.h
src/menu/menu.c
src/theme.c

index 46016aa932c2fba76c5c00bc97318d3c919b92ca..d1657ea93bb19c39b1b685fd09976d43c04ad7fd 100644 (file)
@@ -102,8 +102,8 @@ struct theme {
        int menu_min_width;
        int menu_max_width;
 
-       int menu_item_padding_x;
-       int menu_item_padding_y;
+       int menu_items_padding_x;
+       int menu_items_padding_y;
        float menu_items_bg_color[4];
        float menu_items_text_color[4];
        float menu_items_active_bg_color[4];
index bbd89964cc6b6bc5333ef5b5851140bcd511ae4c..c8e6c10b3748553cba96ee53bfcbd0fe180890d6 100644 (file)
@@ -118,7 +118,7 @@ menu_update_width(struct menu *menu)
                                ? item->native_width : theme->menu_max_width;
                }
        }
-       menu->size.width = max_width + 2 * theme->menu_item_padding_x;
+       menu->size.width = max_width + 2 * theme->menu_items_padding_x;
 
        /*
         * TODO: This function is getting a bit unwieldy. Consider calculating
@@ -275,7 +275,7 @@ item_create(struct menu *menu, const char *text, bool show_arrow)
                theme->menu_items_active_bg_color, arrow);
 
        /* Center font nodes */
-       x = theme->menu_item_padding_x;
+       x = theme->menu_items_padding_x;
        y = (theme->menu_item_height - menuitem->normal.buffer->height) / 2;
        wlr_scene_node_set_position(menuitem->normal.text, x, y);
        y = (theme->menu_item_height - menuitem->selected.buffer->height) / 2;
@@ -347,7 +347,7 @@ separator_create(struct menu *menu, const char *label)
                        text_color, bg_color, /* arrow */ NULL);
                /* Center font nodes */
                int x, y;
-               x = theme->menu_item_padding_x;
+               x = theme->menu_items_padding_x;
                y = (theme->menu_header_height - menuitem->normal.buffer->height) / 2;
                wlr_scene_node_set_position(menuitem->normal.text, x, y);
        } else {
index 05c668b9d85b70c767423f5c4da977676749ea34..0e503ce160fc0389c6cb2e48cc7b5268b045d0b9 100644 (file)
@@ -599,8 +599,8 @@ theme_builtin(struct theme *theme, struct server *server)
        theme->menu_min_width = 20;
        theme->menu_max_width = 200;
 
-       theme->menu_item_padding_x = 7;
-       theme->menu_item_padding_y = 4;
+       theme->menu_items_padding_x = 7;
+       theme->menu_items_padding_y = 4;
        parse_hexstr("#fcfbfa", theme->menu_items_bg_color);
        parse_hexstr("#000000", theme->menu_items_text_color);
        parse_hexstr("#e1dedb", theme->menu_items_active_bg_color);
@@ -869,11 +869,11 @@ entry(struct theme *theme, const char *key, const char *value)
        }
 
        if (match_glob(key, "menu.items.padding.x")) {
-               theme->menu_item_padding_x = get_int_if_positive(
+               theme->menu_items_padding_x = get_int_if_positive(
                        value, "menu.items.padding.x");
        }
        if (match_glob(key, "menu.items.padding.y")) {
-               theme->menu_item_padding_y = get_int_if_positive(
+               theme->menu_items_padding_y = get_int_if_positive(
                        value, "menu.items.padding.y");
        }
        if (match_glob(key, "menu.items.bg.color")) {
@@ -1448,10 +1448,10 @@ post_processing(struct theme *theme)
        theme->title_height = get_titlebar_height(theme);
 
        theme->menu_item_height = font_height(&rc.font_menuitem)
-               + 2 * theme->menu_item_padding_y;
+               + 2 * theme->menu_items_padding_y;
 
        theme->menu_header_height = font_height(&rc.font_menuheader)
-               + 2 * theme->menu_item_padding_y;
+               + 2 * theme->menu_items_padding_y;
 
        theme->osd_window_switcher_item_height = font_height(&rc.font_osd)
                + 2 * theme->osd_window_switcher_item_padding_y