Add alpha toggle
This commit is contained in:
parent
36621083ae
commit
c95915fca6
10
drw.c
10
drw.c
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include "drw.h"
|
||||
#include "util.h"
|
||||
#include "toggle.h"
|
||||
|
||||
#define UTF_INVALID 0xFFFD
|
||||
#define UTF_SIZ 4
|
||||
|
@ -209,12 +210,15 @@ drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha)
|
|||
if (!drw || !dest || !clrname)
|
||||
return;
|
||||
|
||||
if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap,
|
||||
clrname, dest))
|
||||
|
||||
if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap, clrname, dest)) {
|
||||
die("error, cannot allocate color '%s'", clrname);
|
||||
}
|
||||
|
||||
#if USEALPHA
|
||||
dest->pixel = (dest->pixel & 0x00ffffffU) | (alpha << 24);
|
||||
#else
|
||||
dest->pixel |= 0xff << 24;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -296,6 +296,7 @@ static char col_status15[] = "#ffffff";
|
|||
* They can be anything from 0 (fully transparent) to 255 (fully opaque).
|
||||
*
|
||||
* You can also set OPAQUE and TRANSPARENT which are the same as 0 and 255 respectively.
|
||||
* To completely disable alpha, disable it in toggle.h.
|
||||
*/
|
||||
static const unsigned int baropacity = 160; /* Opacity for the overall bar */
|
||||
static const unsigned int layoutopacity = 160; /* Opacity for the layout indicator */
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
//#include <libgen.h>
|
||||
//#include <sys/stat.h>
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
|
1
toggle.h
1
toggle.h
|
@ -2,3 +2,4 @@
|
|||
* This header allows you to enable/disable patches that can break compability with certain OSes or configurations.
|
||||
*/
|
||||
#define USEIPC 1 /* Whether or not to use IPC. If you set this to 1, set USEIPC to true in config.mk and comment the YAJLLIBS and YAJLINC lines in config.mk. Not compatible with BSDs so for those, set this to 0. */
|
||||
#define USEALPHA 1 /* Whether or not to use transparency for the bar */
|
||||
|
|
Loading…
Reference in a new issue