From 13168d758a05b88c2bd716ed016cf5577ea02735 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 25 Mar 2008 14:56:21 +0100 Subject: [PATCH] Add a function to remove titlebar geometry Signed-off-by: Julien Danjou --- titlebar.c | 29 +++++++++++++++++++++++++++++ titlebar.h | 1 + 2 files changed, 30 insertions(+) diff --git a/titlebar.c b/titlebar.c index 5f8d39ad..b2459fa4 100644 --- a/titlebar.c +++ b/titlebar.c @@ -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) { diff --git a/titlebar.h b/titlebar.h index 23eac88c..fdd39d13 100644 --- a/titlebar.h +++ b/titlebar.h @@ -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;