mirror of
https://github.com/labwc/labwc.git
synced 2026-02-22 01:40:25 -05:00
Add deco parts top, right and bottom
This commit is contained in:
parent
a6ac2a0439
commit
c07acc9ee6
7 changed files with 104 additions and 22 deletions
25
src/deco.c
25
src/deco.c
|
|
@ -18,18 +18,37 @@ struct wlr_box deco_box(struct view *view, enum deco_part deco_part)
|
|||
if (!view || !view->surface)
|
||||
return box;
|
||||
switch (deco_part) {
|
||||
case LAB_DECO_PART_TITLE:
|
||||
box.x = view->x;
|
||||
box.y = view->y - XWL_TITLEBAR_HEIGHT;
|
||||
box.width = view->surface->current.width;
|
||||
box.height = XWL_TITLEBAR_HEIGHT;
|
||||
break;
|
||||
case LAB_DECO_PART_TOP:
|
||||
box.x = view->x - XWL_WINDOW_BORDER;
|
||||
box.y = view->y - XWL_TITLEBAR_HEIGHT - XWL_WINDOW_BORDER;
|
||||
box.width =
|
||||
view->surface->current.width + 2 * XWL_WINDOW_BORDER;
|
||||
box.height = XWL_TITLEBAR_HEIGHT + XWL_WINDOW_BORDER;
|
||||
box.height = + XWL_WINDOW_BORDER;
|
||||
break;
|
||||
case LAB_DECO_PART_RIGHT:
|
||||
box.x = view->x + view->surface->current.width;
|
||||
box.y = view->y - XWL_TITLEBAR_HEIGHT;
|
||||
box.width = XWL_WINDOW_BORDER;
|
||||
box.height = view->surface->current.height + XWL_TITLEBAR_HEIGHT;
|
||||
break;
|
||||
case LAB_DECO_PART_BOTTOM:
|
||||
box.x = view->x - XWL_WINDOW_BORDER;
|
||||
box.y = view->y + view->surface->current.height;
|
||||
box.width =
|
||||
view->surface->current.width + 2 * XWL_WINDOW_BORDER;
|
||||
box.height = + XWL_WINDOW_BORDER;
|
||||
break;
|
||||
case LAB_DECO_PART_LEFT:
|
||||
box.x = view->x - XWL_WINDOW_BORDER;
|
||||
box.y = view->y;
|
||||
box.y = view->y - XWL_TITLEBAR_HEIGHT;
|
||||
box.width = XWL_WINDOW_BORDER;
|
||||
box.height = view->surface->current.height;
|
||||
box.height = view->surface->current.height + XWL_TITLEBAR_HEIGHT;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue