theme: reorder theme entries in documentation and codebase

This commit is contained in:
tokyo4j 2024-11-12 09:17:04 +09:00 committed by Johan Malm
parent eaf11face6
commit 720ae1fc87
3 changed files with 104 additions and 110 deletions

View file

@ -59,38 +59,6 @@ labwc-config(5).
Vertical titlebar padding size, in pixels. Vertical titlebar padding size, in pixels.
Default is 0. Default is 0.
*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.title.text.justify*
Specifies how menu titles are aligned in the titlebar.
Type justification. Default Center.
*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
negative value creates a gap between submenus and their parents.
Default is 0.
*menu.overlap.y*
Vertical offset in pixels between submenus and their parents. Positive
values for downwards and negative for upwards. Default is 0.
*menu.width.min*
Minimal width for menus. Default is 20.
A fixed width can be achieved by setting .min and .max to the same
value.
*menu.width.max*
Maximal width for menus. Default is 200.
A fixed width can be achieved by setting .min and .max to the same
value.
*window.active.border.color* *window.active.border.color*
Border color of active window. Border color of active window.
@ -176,6 +144,34 @@ all are supported.
Color of drop-shadows for non-focused windows, including opacity. Color of drop-shadows for non-focused windows, including opacity.
Default is #00000040 (black with 25% opacity). Default is #00000040 (black with 25% opacity).
*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
negative value creates a gap between submenus and their parents.
Default is 0.
*menu.overlap.y*
Vertical offset in pixels between submenus and their parents. Positive
values for downwards and negative for upwards. Default is 0.
*menu.width.min*
Minimal width for menus. Default is 20.
A fixed width can be achieved by setting .min and .max to the same
value.
*menu.width.max*
Maximal width for menus. Default is 200.
A fixed width can be achieved by setting .min and .max to the same
value.
*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.items.bg.color* *menu.items.bg.color*
Background color of inactive menu items. Background color of inactive menu items.
@ -204,6 +200,10 @@ all are supported.
Menu title color. Default #589bda. Menu title color. Default #589bda.
Note: A menu title is a separator with a label. Note: A menu title is a separator with a label.
*menu.title.text.justify*
Specifies how menu titles are aligned in the titlebar.
Type justification. Default Center.
*menu.title.text.color* *menu.title.text.color*
Text color of separator label. Default #ffffff. Text color of separator label. Default #ffffff.

View file

@ -45,8 +45,6 @@ struct theme {
int window_titlebar_padding_height; int window_titlebar_padding_height;
int title_height; int title_height;
int menu_overlap_x;
int menu_overlap_y;
/* colors */ /* colors */
float window_active_border_color[4]; float window_active_border_color[4];
@ -60,7 +58,6 @@ struct theme {
float window_active_label_text_color[4]; float window_active_label_text_color[4];
float window_inactive_label_text_color[4]; float window_inactive_label_text_color[4];
enum lab_justification window_label_text_justify; enum lab_justification window_label_text_justify;
enum lab_justification menu_title_text_justify;
/* buttons */ /* buttons */
int window_button_width; int window_button_width;
@ -70,50 +67,6 @@ struct theme {
/* the corner radius of the hover effect */ /* the corner radius of the hover effect */
int window_button_hover_bg_corner_radius; int window_button_hover_bg_corner_radius;
int menu_item_padding_x;
int menu_item_padding_y;
int menu_item_height;
int menu_header_height;
float menu_items_bg_color[4];
float menu_items_text_color[4];
float menu_items_active_bg_color[4];
float menu_items_active_text_color[4];
int menu_min_width;
int menu_max_width;
int menu_separator_line_thickness;
int menu_separator_padding_width;
int menu_separator_padding_height;
float menu_separator_color[4];
float menu_title_bg_color[4];
float menu_title_text_color[4];
int osd_border_width;
float osd_bg_color[4];
float osd_border_color[4];
float osd_label_text_color[4];
int osd_window_switcher_width;
int osd_window_switcher_padding;
int osd_window_switcher_item_padding_x;
int osd_window_switcher_item_padding_y;
int osd_window_switcher_item_active_border_width;
bool osd_window_switcher_width_is_percent;
int osd_window_switcher_preview_border_width;
float osd_window_switcher_preview_border_color[3][4];
int osd_workspace_switcher_boxes_width;
int osd_workspace_switcher_boxes_height;
struct theme_snapping_overlay
snapping_overlay_region, snapping_overlay_edge;
/* window drop-shadows */ /* window drop-shadows */
int window_active_shadow_size; int window_active_shadow_size;
int window_inactive_shadow_size; int window_inactive_shadow_size;
@ -139,8 +92,52 @@ struct theme {
} window[2]; /* indexed by THEME_INACTIVE and THEME_ACTIVE */ } window[2]; /* indexed by THEME_INACTIVE and THEME_ACTIVE */
/* textures */ int menu_item_height;
int menu_header_height;
int menu_overlap_x;
int menu_overlap_y;
int menu_min_width;
int menu_max_width;
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];
float menu_items_active_text_color[4];
int menu_separator_line_thickness;
int menu_separator_padding_width;
int menu_separator_padding_height;
float menu_separator_color[4];
float menu_title_bg_color[4];
enum lab_justification menu_title_text_justify;
float menu_title_text_color[4];
int osd_border_width;
float osd_bg_color[4];
float osd_border_color[4];
float osd_label_text_color[4];
int osd_window_switcher_width;
int osd_window_switcher_padding;
int osd_window_switcher_item_padding_x;
int osd_window_switcher_item_padding_y;
int osd_window_switcher_item_active_border_width;
bool osd_window_switcher_width_is_percent;
int osd_window_switcher_preview_border_width;
float osd_window_switcher_preview_border_color[3][4];
int osd_workspace_switcher_boxes_width;
int osd_workspace_switcher_boxes_height;
struct theme_snapping_overlay
snapping_overlay_region, snapping_overlay_edge;
/* textures */
struct lab_data_buffer *corner_top_left_active_normal; struct lab_data_buffer *corner_top_left_active_normal;
struct lab_data_buffer *corner_top_right_active_normal; struct lab_data_buffer *corner_top_right_active_normal;
struct lab_data_buffer *corner_top_left_inactive_normal; struct lab_data_buffer *corner_top_left_inactive_normal;

View file

@ -563,8 +563,6 @@ theme_builtin(struct theme *theme, struct server *server)
theme->window_titlebar_padding_height = 0; theme->window_titlebar_padding_height = 0;
theme->window_titlebar_padding_width = 0; theme->window_titlebar_padding_width = 0;
theme->title_height = INT_MIN; theme->title_height = INT_MIN;
theme->menu_overlap_x = 0;
theme->menu_overlap_y = 0;
parse_hexstr("#e1dedb", theme->window_active_border_color); parse_hexstr("#e1dedb", theme->window_active_border_color);
parse_hexstr("#f6f5f4", theme->window_inactive_border_color); parse_hexstr("#f6f5f4", theme->window_inactive_border_color);
@ -577,7 +575,6 @@ theme_builtin(struct theme *theme, struct server *server)
parse_hexstr("#000000", theme->window_active_label_text_color); parse_hexstr("#000000", theme->window_active_label_text_color);
parse_hexstr("#000000", theme->window_inactive_label_text_color); parse_hexstr("#000000", theme->window_inactive_label_text_color);
theme->window_label_text_justify = parse_justification("Center"); theme->window_label_text_justify = parse_justification("Center");
theme->menu_title_text_justify = parse_justification("Center");
theme->window_button_width = 26; theme->window_button_width = 26;
theme->window_button_height = 26; theme->window_button_height = 26;
@ -597,24 +594,25 @@ theme_builtin(struct theme *theme, struct server *server)
parse_hexstr("#00000060", theme->window_active_shadow_color); parse_hexstr("#00000060", theme->window_active_shadow_color);
parse_hexstr("#00000040", theme->window_inactive_shadow_color); parse_hexstr("#00000040", theme->window_inactive_shadow_color);
theme->menu_overlap_x = 0;
theme->menu_overlap_y = 0;
theme->menu_min_width = 20;
theme->menu_max_width = 200;
theme->menu_item_padding_x = 7;
theme->menu_item_padding_y = 4;
parse_hexstr("#fcfbfa", theme->menu_items_bg_color); parse_hexstr("#fcfbfa", theme->menu_items_bg_color);
parse_hexstr("#000000", theme->menu_items_text_color); parse_hexstr("#000000", theme->menu_items_text_color);
parse_hexstr("#e1dedb", theme->menu_items_active_bg_color); parse_hexstr("#e1dedb", theme->menu_items_active_bg_color);
parse_hexstr("#000000", theme->menu_items_active_text_color); parse_hexstr("#000000", theme->menu_items_active_text_color);
theme->menu_item_padding_x = 7;
theme->menu_item_padding_y = 4;
theme->menu_min_width = 20;
theme->menu_max_width = 200;
theme->menu_separator_line_thickness = 1; theme->menu_separator_line_thickness = 1;
theme->menu_separator_padding_width = 6; theme->menu_separator_padding_width = 6;
theme->menu_separator_padding_height = 3; theme->menu_separator_padding_height = 3;
parse_hexstr("#888888", theme->menu_separator_color); parse_hexstr("#888888", theme->menu_separator_color);
parse_hexstr("#589bda", theme->menu_title_bg_color); parse_hexstr("#589bda", theme->menu_title_bg_color);
theme->menu_title_text_justify = parse_justification("Center");
parse_hexstr("#ffffff", theme->menu_title_text_color); parse_hexstr("#ffffff", theme->menu_title_text_color);
theme->osd_window_switcher_width = 600; theme->osd_window_switcher_width = 600;
@ -708,25 +706,6 @@ entry(struct theme *theme, const char *key, const char *value)
if (match_glob(key, "padding.height")) { if (match_glob(key, "padding.height")) {
wlr_log(WLR_ERROR, "padding.height is no longer supported"); wlr_log(WLR_ERROR, "padding.height is no longer supported");
} }
if (match_glob(key, "menu.items.padding.x")) {
theme->menu_item_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(
value, "menu.items.padding.y");
}
if (match_glob(key, "menu.title.text.justify")) {
theme->menu_title_text_justify = parse_justification(value);
}
if (match_glob(key, "menu.overlap.x")) {
theme->menu_overlap_x = get_int_if_positive(
value, "menu.overlap.x");
}
if (match_glob(key, "menu.overlap.y")) {
theme->menu_overlap_y = get_int_if_positive(
value, "menu.overlap.y");
}
if (match_glob(key, "window.active.border.color")) { if (match_glob(key, "window.active.border.color")) {
parse_hexstr(value, theme->window_active_border_color); parse_hexstr(value, theme->window_active_border_color);
@ -872,6 +851,14 @@ entry(struct theme *theme, const char *key, const char *value)
parse_hexstr(value, theme->window_inactive_shadow_color); parse_hexstr(value, theme->window_inactive_shadow_color);
} }
if (match_glob(key, "menu.overlap.x")) {
theme->menu_overlap_x = get_int_if_positive(
value, "menu.overlap.x");
}
if (match_glob(key, "menu.overlap.y")) {
theme->menu_overlap_y = get_int_if_positive(
value, "menu.overlap.y");
}
if (match_glob(key, "menu.width.min")) { if (match_glob(key, "menu.width.min")) {
theme->menu_min_width = get_int_if_positive( theme->menu_min_width = get_int_if_positive(
value, "menu.width.min"); value, "menu.width.min");
@ -881,6 +868,14 @@ entry(struct theme *theme, const char *key, const char *value)
value, "menu.width.max"); value, "menu.width.max");
} }
if (match_glob(key, "menu.items.padding.x")) {
theme->menu_item_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(
value, "menu.items.padding.y");
}
if (match_glob(key, "menu.items.bg.color")) { if (match_glob(key, "menu.items.bg.color")) {
parse_hexstr(value, theme->menu_items_bg_color); parse_hexstr(value, theme->menu_items_bg_color);
} }
@ -913,7 +908,9 @@ entry(struct theme *theme, const char *key, const char *value)
if (match_glob(key, "menu.title.bg.color")) { if (match_glob(key, "menu.title.bg.color")) {
parse_hexstr(value, theme->menu_title_bg_color); parse_hexstr(value, theme->menu_title_bg_color);
} }
if (match_glob(key, "menu.title.text.justify")) {
theme->menu_title_text_justify = parse_justification(value);
}
if (match_glob(key, "menu.title.text.color")) { if (match_glob(key, "menu.title.text.color")) {
parse_hexstr(value, theme->menu_title_text_color); parse_hexstr(value, theme->menu_title_text_color);
} }