titlebar: add position in __newindex

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-08-08 17:15:23 +02:00
parent bfad5a0d0d
commit cde948bd61
1 changed files with 12 additions and 0 deletions

View File

@ -362,6 +362,7 @@ luaA_titlebar_newindex(lua_State *L)
client_t *c = NULL, **newc; client_t *c = NULL, **newc;
int i; int i;
widget_node_t *witer; widget_node_t *witer;
position_t position;
switch(a_tokenize(attr, len)) switch(a_tokenize(attr, len))
{ {
@ -455,6 +456,17 @@ luaA_titlebar_newindex(lua_State *L)
lua_pop(L, 1); lua_pop(L, 1);
} }
break; break;
case A_TK_POSITION:
buf = luaL_checklstring(L, 3, &len);
position = position_fromstr(buf, len);
if(position != (*titlebar)->position)
{
(*titlebar)->position = position;
c = client_getbytitlebar(*titlebar);
simplewindow_delete(&c->titlebar->sw);
titlebar_init(c);
}
break;
default: default:
return 0; return 0;
} }