Explicitly differentiate between 'no border' and 'flat border' since it's visible with gradients

This commit is contained in:
Jack Zeal 2026-04-04 07:38:27 -07:00
parent 4d0ec36773
commit 43d643c878
3 changed files with 13 additions and 11 deletions

View file

@ -5,7 +5,7 @@
#define LABWC_BORDERSET_H #define LABWC_BORDERSET_H
enum border_type { enum border_type {
BORDER_FLAT, BORDER_SINGLE, BORDER_DOUBLE, BORDER_INSET, BORDER_DOUBLE_INSET BORDER_NONE, BORDER_SINGLE, BORDER_DOUBLE, BORDER_INSET, BORDER_DOUBLE_INSET, BORDER_FLAT
}; };
struct borderset { struct borderset {

View file

@ -238,6 +238,7 @@ struct borderset * createBuffer(uint32_t id, int size, enum border_type type, i
break; break;
case BORDER_FLAT: // Placeholder that uses buffers but for a flat colour case BORDER_FLAT: // Placeholder that uses buffers but for a flat colour
case BORDER_NONE: // Provided as a fallback but should not be actually requested/rendered
top = znew(uint32_t); top = znew(uint32_t);
left = znew(uint32_t); left = znew(uint32_t);
right = znew(uint32_t); right = znew(uint32_t);

View file

@ -457,7 +457,8 @@ static enum border_type parse_border_type(const char *str) {
else if (strstr(lower, "sunken")) border_type = BORDER_INSET; else if (strstr(lower, "sunken")) border_type = BORDER_INSET;
else if (strstr(lower, "doubleraised")) border_type = BORDER_DOUBLE; else if (strstr(lower, "doubleraised")) border_type = BORDER_DOUBLE;
else if (strstr(lower, "raised")) border_type = BORDER_SINGLE; else if (strstr(lower, "raised")) border_type = BORDER_SINGLE;
else border_type = BORDER_FLAT; else if (strstr(lower, "flat")) border_type = BORDER_FLAT;
else border_type = BORDER_NONE;
g_free(lower); g_free(lower);
return border_type; return border_type;
@ -564,17 +565,17 @@ theme_builtin(struct theme *theme)
theme->window[SSD_ACTIVE].title_bg.color_to_split_to[0] = FLT_MIN; theme->window[SSD_ACTIVE].title_bg.color_to_split_to[0] = FLT_MIN;
theme->window[SSD_INACTIVE].title_bg.color_to_split_to[0] = FLT_MIN; theme->window[SSD_INACTIVE].title_bg.color_to_split_to[0] = FLT_MIN;
theme->window[SSD_ACTIVE].bevel_width = 0; theme->window[SSD_ACTIVE].bevel_width = 0;
theme->window[SSD_ACTIVE].border_type = BORDER_FLAT; theme->window[SSD_ACTIVE].border_type = BORDER_NONE;
theme->window[SSD_ACTIVE].title_bg.bevel_width = 0; theme->window[SSD_ACTIVE].title_bg.bevel_width = 0;
theme->window[SSD_ACTIVE].title_bg.border_width = 0; theme->window[SSD_ACTIVE].title_bg.border_width = 0;
theme->window[SSD_ACTIVE].title_bg.exclusive = FALSE; theme->window[SSD_ACTIVE].title_bg.exclusive = FALSE;
theme->window[SSD_ACTIVE].title_bg.border_type = BORDER_FLAT; theme->window[SSD_ACTIVE].title_bg.border_type = BORDER_NONE;
theme->window[SSD_INACTIVE].bevel_width = 0; theme->window[SSD_INACTIVE].bevel_width = 0;
theme->window[SSD_INACTIVE].border_type = BORDER_FLAT; theme->window[SSD_INACTIVE].border_type = BORDER_NONE;
theme->window[SSD_INACTIVE].title_bg.bevel_width = 0; theme->window[SSD_INACTIVE].title_bg.bevel_width = 0;
theme->window[SSD_INACTIVE].title_bg.border_width = 0; theme->window[SSD_INACTIVE].title_bg.border_width = 0;
theme->window[SSD_INACTIVE].title_bg.exclusive = FALSE; theme->window[SSD_INACTIVE].title_bg.exclusive = FALSE;
theme->window[SSD_INACTIVE].title_bg.border_type = BORDER_FLAT; theme->window[SSD_INACTIVE].title_bg.border_type = BORDER_NONE;
parse_hexstr("#000000", theme->window[SSD_ACTIVE].label_text_color); parse_hexstr("#000000", theme->window[SSD_ACTIVE].label_text_color);
parse_hexstr("#000000", theme->window[SSD_INACTIVE].label_text_color); parse_hexstr("#000000", theme->window[SSD_INACTIVE].label_text_color);
@ -606,7 +607,7 @@ theme_builtin(struct theme *theme)
theme->menu_max_width = 200; theme->menu_max_width = 200;
theme->menu_border_width = INT_MIN; theme->menu_border_width = INT_MIN;
theme->menu_border_color[0] = FLT_MIN; theme->menu_border_color[0] = FLT_MIN;
theme->menu_border_type = BORDER_FLAT; theme->menu_border_type = BORDER_NONE;
theme->menu_bevel_width = 0; theme->menu_bevel_width = 0;
theme->menu_items_padding_x = 7; theme->menu_items_padding_x = 7;
@ -615,11 +616,11 @@ theme_builtin(struct theme *theme)
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_items_border_type = BORDER_FLAT; theme->menu_items_border_type = BORDER_NONE;
theme->menu_items_bevel_width = 0; theme->menu_items_bevel_width = 0;
theme->menu_title_border_type = BORDER_FLAT; theme->menu_title_border_type = BORDER_NONE;
theme->menu_title_bevel_width = 0; theme->menu_title_bevel_width = 0;
theme->menu_items_active_border_type = BORDER_FLAT; theme->menu_items_active_border_type = BORDER_NONE;
theme->menu_items_active_bevel_width = 0; theme->menu_items_active_bevel_width = 0;
theme->menu_separator_line_thickness = 1; theme->menu_separator_line_thickness = 1;
@ -666,7 +667,7 @@ theme_builtin(struct theme *theme)
theme->osd_border_width = INT_MIN; theme->osd_border_width = INT_MIN;
theme->osd_border_color[0] = FLT_MIN; theme->osd_border_color[0] = FLT_MIN;
theme->osd_label_text_color[0] = FLT_MIN; theme->osd_label_text_color[0] = FLT_MIN;
theme->osd_border_type = BORDER_FLAT; theme->osd_border_type = BORDER_NONE;
theme->osd_border_bevel_width = 0; theme->osd_border_bevel_width = 0;
if (wlr_renderer_is_pixman(server.renderer)) { if (wlr_renderer_is_pixman(server.renderer)) {