Support inactive unpressed icons

This commit is contained in:
Johan Malm 2020-08-21 20:35:06 +01:00
parent e62c251a74
commit 83331e57ed
6 changed files with 48 additions and 17 deletions

View file

@ -42,23 +42,24 @@ struct wlr_box deco_box(struct view *view, enum deco_part deco_part)
}
switch (deco_part) {
case LAB_DECO_BUTTON_CLOSE:
wlr_texture_get_size(theme.xbm_close, &box.width, &box.height);
wlr_texture_get_size(theme.xbm_close_active_unpressed,
&box.width, &box.height);
margin = (rc.title_height - box.height) / 2;
box.x = view->x + view->surface->current.width + margin -
rc.title_height;
box.y = view->y - rc.title_height + margin;
break;
case LAB_DECO_BUTTON_MAXIMIZE:
wlr_texture_get_size(theme.xbm_maximize, &box.width,
&box.height);
wlr_texture_get_size(theme.xbm_maximize_active_unpressed,
&box.width, &box.height);
margin = (rc.title_height - box.height) / 2;
box.x = view->x + view->surface->current.width + margin -
rc.title_height * 2;
box.y = view->y - rc.title_height + margin;
break;
case LAB_DECO_BUTTON_ICONIFY:
wlr_texture_get_size(theme.xbm_iconify, &box.width,
&box.height);
wlr_texture_get_size(theme.xbm_iconify_active_unpressed,
&box.width, &box.height);
margin = (rc.title_height - box.height) / 2;
box.x = view->x + view->surface->current.width + margin -
rc.title_height * 3;