[titlebar] Reuse geometry_remove function
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
0a9b206fc0
commit
38ad723055
14
titlebar.c
14
titlebar.c
|
@ -369,8 +369,6 @@ titlebar_update_geometry(Client *c, area_t geometry)
|
||||||
geometry.y,
|
geometry.y,
|
||||||
width,
|
width,
|
||||||
c->titlebar.sw->geometry.height);
|
c->titlebar.sw->geometry.height);
|
||||||
geometry.y += c->titlebar.sw->geometry.height;
|
|
||||||
geometry.height -= c->titlebar.sw->geometry.height;
|
|
||||||
break;
|
break;
|
||||||
case Bottom:
|
case Bottom:
|
||||||
if(!c->titlebar.width)
|
if(!c->titlebar.width)
|
||||||
|
@ -388,10 +386,10 @@ titlebar_update_geometry(Client *c, area_t geometry)
|
||||||
x_offset = (geometry.width - width) / 2;
|
x_offset = (geometry.width - width) / 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
geometry.height -= c->titlebar.sw->geometry.height;
|
|
||||||
simplewindow_move_resize(c->titlebar.sw,
|
simplewindow_move_resize(c->titlebar.sw,
|
||||||
geometry.x + x_offset,
|
geometry.x + x_offset,
|
||||||
geometry.y + geometry.height + 2 * c->border,
|
geometry.y + geometry.height
|
||||||
|
- c->titlebar.sw->geometry.height + 2 * c->border,
|
||||||
width,
|
width,
|
||||||
c->titlebar.sw->geometry.height);
|
c->titlebar.sw->geometry.height);
|
||||||
break;
|
break;
|
||||||
|
@ -416,8 +414,6 @@ titlebar_update_geometry(Client *c, area_t geometry)
|
||||||
geometry.y + y_offset,
|
geometry.y + y_offset,
|
||||||
c->titlebar.sw->geometry.width,
|
c->titlebar.sw->geometry.width,
|
||||||
width);
|
width);
|
||||||
geometry.width -= c->titlebar.sw->geometry.width;
|
|
||||||
geometry.x += c->titlebar.sw->geometry.width;
|
|
||||||
break;
|
break;
|
||||||
case Right:
|
case Right:
|
||||||
if(!c->titlebar.width)
|
if(!c->titlebar.width)
|
||||||
|
@ -435,9 +431,9 @@ titlebar_update_geometry(Client *c, area_t geometry)
|
||||||
y_offset = (geometry.height - width) / 2;
|
y_offset = (geometry.height - width) / 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
geometry.width -= c->titlebar.sw->geometry.width;
|
|
||||||
simplewindow_move_resize(c->titlebar.sw,
|
simplewindow_move_resize(c->titlebar.sw,
|
||||||
geometry.x + geometry.width + 2 * c->border,
|
geometry.x + geometry.width
|
||||||
|
- c->titlebar.sw->geometry.width + 2 * c->border,
|
||||||
geometry.y + y_offset,
|
geometry.y + y_offset,
|
||||||
c->titlebar.sw->geometry.width,
|
c->titlebar.sw->geometry.width,
|
||||||
width);
|
width);
|
||||||
|
@ -446,7 +442,7 @@ titlebar_update_geometry(Client *c, area_t geometry)
|
||||||
|
|
||||||
titlebar_update(c);
|
titlebar_update(c);
|
||||||
|
|
||||||
return geometry;
|
return titlebar_geometry_remove(&c->titlebar, geometry);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Toggle window titlebar visibility
|
/** Toggle window titlebar visibility
|
||||||
|
|
Loading…
Reference in New Issue