Add a function to remove titlebar geometry

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-03-25 14:56:21 +01:00
parent f47ca7cda7
commit 13168d758a
2 changed files with 30 additions and 0 deletions

View File

@ -131,6 +131,35 @@ titlebar_geometry_add(Titlebar *t, area_t geometry)
return geometry;
}
area_t
titlebar_geometry_remove(Titlebar *t, area_t geometry)
{
if(!t->sw)
return geometry;
switch(t->position)
{
case Top:
geometry.y += t->sw->geometry.height;
geometry.height -= t->sw->geometry.height;
break;
case Bottom:
geometry.height -= t->sw->geometry.height;
break;
case Left:
geometry.x += t->sw->geometry.width;
geometry.width -= t->sw->geometry.width;
break;
case Right:
geometry.width -= t->sw->geometry.width;
break;
default:
break;
}
return geometry;
}
void
titlebar_update(Client *c)
{

View File

@ -29,6 +29,7 @@ void titlebar_update(Client *);
void titlebar_update_geometry_floating(Client *);
area_t titlebar_update_geometry(Client *, area_t);
area_t titlebar_geometry_add(Titlebar *, area_t);
area_t titlebar_geometry_remove(Titlebar *, area_t);
Uicb uicb_client_toggletitlebar;