mirror of
https://github.com/labwc/labwc.git
synced 2025-11-03 09:01:51 -05:00
theme: add window.inactive.border.color
This commit is contained in:
parent
31d3a53e46
commit
8f8a6dfea1
3 changed files with 25 additions and 8 deletions
|
|
@ -13,11 +13,12 @@
|
|||
struct theme {
|
||||
int border_width;
|
||||
|
||||
float window_active_border_color[4];
|
||||
float window_inactive_border_color[4];
|
||||
|
||||
float window_active_title_bg_color[4];
|
||||
float window_inactive_title_bg_color[4];
|
||||
|
||||
float window_active_border_color[4];
|
||||
|
||||
float window_active_button_unpressed_image_color[4];
|
||||
float window_inactive_button_unpressed_image_color[4];
|
||||
|
||||
|
|
|
|||
11
src/ssd.c
11
src/ssd.c
|
|
@ -257,7 +257,7 @@ ssd_create(struct view *view)
|
|||
part = add_part(view, border[i]);
|
||||
part->box = ssd_box(view, border[i]);
|
||||
part->color.active = theme->window_active_border_color;
|
||||
part->color.inactive = theme->window_active_border_color;
|
||||
part->color.inactive = theme->window_inactive_border_color;
|
||||
}
|
||||
|
||||
/* titlebar */
|
||||
|
|
@ -266,7 +266,7 @@ ssd_create(struct view *view)
|
|||
part->color.active = theme->window_active_title_bg_color;
|
||||
part->color.inactive = theme->window_inactive_title_bg_color;
|
||||
|
||||
/* titlebar top left corner */
|
||||
/* titlebar active top left corner */
|
||||
struct wlr_renderer *renderer = view->server->renderer;
|
||||
part = add_part(view, LAB_SSD_PART_CORNER_TOP_LEFT);
|
||||
part->box = ssd_box(view, part->type);
|
||||
|
|
@ -280,18 +280,23 @@ ssd_create(struct view *view)
|
|||
};
|
||||
part->texture.active = rounded_rect(renderer, &ctx);
|
||||
|
||||
/* titlebar inactive top left corner */
|
||||
ctx.fill_color = theme->window_inactive_title_bg_color,
|
||||
ctx.border_color = theme->window_inactive_border_color,
|
||||
part->texture.inactive = rounded_rect(renderer, &ctx);
|
||||
|
||||
/* titlebar top right corner */
|
||||
/* titlebar active top right corner */
|
||||
part = add_part(view, LAB_SSD_PART_CORNER_TOP_RIGHT);
|
||||
part->box = ssd_box(view, part->type);
|
||||
ctx.box = &part->box;
|
||||
ctx.corner = LAB_CORNER_TOP_RIGHT;
|
||||
ctx.fill_color = theme->window_active_title_bg_color,
|
||||
ctx.border_color = theme->window_active_border_color,
|
||||
part->texture.active = rounded_rect(renderer, &ctx);
|
||||
|
||||
/* titlebar inactive top right corner */
|
||||
ctx.fill_color = theme->window_inactive_title_bg_color,
|
||||
ctx.border_color = theme->window_inactive_border_color,
|
||||
part->texture.inactive = rounded_rect(renderer, &ctx);
|
||||
}
|
||||
|
||||
|
|
|
|||
17
src/theme.c
17
src/theme.c
|
|
@ -64,11 +64,16 @@ parse_hexstr(const char *hex, float *rgba)
|
|||
void theme_builtin(struct theme *theme)
|
||||
{
|
||||
theme->border_width = 1;
|
||||
parse_hexstr("#589bda", theme->window_active_title_bg_color);
|
||||
|
||||
parse_hexstr("#3c7cb7", theme->window_active_border_color);
|
||||
parse_hexstr("#efece6", theme->window_inactive_border_color);
|
||||
|
||||
parse_hexstr("#589bda", theme->window_active_title_bg_color);
|
||||
parse_hexstr("#efece6", theme->window_inactive_title_bg_color);
|
||||
|
||||
parse_hexstr("#ffffff", theme->window_active_button_unpressed_image_color);
|
||||
parse_hexstr("#000000", theme->window_inactive_button_unpressed_image_color);
|
||||
|
||||
parse_hexstr("#fcfbfa", theme->menu_items_bg_color);
|
||||
parse_hexstr("#000000", theme->menu_items_text_color);
|
||||
parse_hexstr("#4a90d9", theme->menu_items_active_bg_color);
|
||||
|
|
@ -88,16 +93,22 @@ static void entry(struct theme *theme, const char *key, const char *value)
|
|||
}
|
||||
if (match(key, "border.width")) {
|
||||
theme->border_width = atoi(value);
|
||||
|
||||
} else if (match(key, "window.active.border.color")) {
|
||||
parse_hexstr(value, theme->window_active_border_color);
|
||||
} else if (match(key, "window.inactive.border.color")) {
|
||||
parse_hexstr(value, theme->window_inactive_border_color);
|
||||
|
||||
} else if (match(key, "window.active.title.bg.color")) {
|
||||
parse_hexstr(value, theme->window_active_title_bg_color);
|
||||
} else if (match(key, "window.active.handle.bg.color")) {
|
||||
parse_hexstr(value, theme->window_active_border_color);
|
||||
} else if (match(key, "window.inactive.title.bg.color")) {
|
||||
parse_hexstr(value, theme->window_inactive_title_bg_color);
|
||||
|
||||
} else if (match(key, "window.active.button.unpressed.image.color")) {
|
||||
parse_hexstr(value, theme->window_active_button_unpressed_image_color);
|
||||
} else if (match(key, "window.inactive.button.unpressed.image.color")) {
|
||||
parse_hexstr(value, theme->window_inactive_button_unpressed_image_color);
|
||||
|
||||
} else if (match(key, "menu.items.bg.color")) {
|
||||
parse_hexstr(value, theme->menu_items_bg_color);
|
||||
} else if (match(key, "menu.items.text.color")) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue