view: add 'struct border margin'

Simplify various view interfaces as a result
This commit is contained in:
Johan Malm 2020-09-15 20:41:01 +01:00
parent 5a77c84fc8
commit 090e78b85a
9 changed files with 91 additions and 101 deletions

View file

@ -10,17 +10,17 @@
#include "common/bug-on.h"
#include "common/log.h"
#define BORDER_WIDTH (1)
#define BORDER_WIDTH (2)
struct wlr_box deco_max_extents(struct view *view)
struct border deco_max_extents(struct view *view)
{
struct wlr_box box = {
.x = view->x - BORDER_WIDTH,
.y = view->y - rc.title_height - BORDER_WIDTH,
.width = view->w + 2 * BORDER_WIDTH,
.height = view->h + rc.title_height + 2 * BORDER_WIDTH,
struct border border = {
.top = rc.title_height + BORDER_WIDTH,
.bottom = BORDER_WIDTH,
.left = BORDER_WIDTH,
.right = BORDER_WIDTH,
};
return box;
return border;
}
struct wlr_box deco_box(struct view *view, enum deco_part deco_part)