wibox.c: add real transparency for wiboxes

Signed-off-by: Gregor Best <farhaven@googlemail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Gregor Best 2009-01-24 23:48:05 +01:00 committed by Julien Danjou
parent b2ce806b05
commit 542312beff
1 changed files with 20 additions and 0 deletions

20
wibox.c
View File

@ -26,6 +26,7 @@
#include "ewmh.h"
#include "screen.h"
#include "common/xcursor.h"
#include "window.h"
extern awesome_t globalconf;
@ -873,6 +874,15 @@ luaA_wibox_index(lua_State *L)
case A_TK_CURSOR:
lua_pushstring(L, (*wibox)->cursor);
break;
case A_TK_OPACITY:
{
double d;
if ((d = window_opacity_get((*wibox)->sw.window)) >= 0)
lua_pushnumber(L, d);
else
return 0;
}
break;
default:
return 0;
}
@ -1059,6 +1069,16 @@ luaA_wibox_newindex(lua_State *L)
wibox_widgets_table_build(L, *wibox);
luaA_table2wtable(L);
break;
case A_TK_OPACITY:
if(lua_isnil(L, 3))
window_opacity_set((*wibox)->sw.window, -1);
else
{
double d = luaL_checknumber(L, 3);
if(d >= 0 && d <= 1)
window_opacity_set((*wibox)->sw.window, d);
}
break;
default:
switch((*wibox)->type)
{