deco: refactor button code

- Make the height+width of buttons the same as the title bar.
- Center icons within the 'button space'
- Show button background color on hover (just hard-coded grey for now)
This commit is contained in:
Johan Malm 2020-09-21 19:24:27 +01:00
parent 3c90cb7945
commit 4ecc5efa73
3 changed files with 56 additions and 21 deletions

View file

@ -90,9 +90,7 @@ static void process_cursor_motion(struct server *server, uint32_t time)
/* TODO: Could we use wlr_xcursor_get_resize_name() here?? */
switch (view_area) {
case LAB_DECO_PART_TITLE:
wlr_xcursor_manager_set_cursor_image(
server->cursor_mgr, XCURSOR_DEFAULT, server->cursor);
case LAB_DECO_NONE:
break;
case LAB_DECO_PART_TOP:
wlr_xcursor_manager_set_cursor_image(
@ -110,6 +108,10 @@ static void process_cursor_motion(struct server *server, uint32_t time)
wlr_xcursor_manager_set_cursor_image(
server->cursor_mgr, "left_side", server->cursor);
break;
default:
wlr_xcursor_manager_set_cursor_image(
server->cursor_mgr, XCURSOR_DEFAULT, server->cursor);
break;
}
if (surface) {
bool focus_changed = seat->pointer_state.focused_surface !=