update alpha on color reload
This commit is contained in:
parent
c91bd9f1e0
commit
b828b27adf
14
st.c
14
st.c
|
@ -2273,9 +2273,18 @@ strhandle(void)
|
|||
return;
|
||||
#if RELOADCOLORS
|
||||
case 4:
|
||||
if (narg < 3)
|
||||
if (narg < 3) {
|
||||
reloadalpha();
|
||||
break;
|
||||
}
|
||||
p = strescseq.args[2];
|
||||
reloadalpha();
|
||||
|
||||
break;
|
||||
#else
|
||||
case 4:
|
||||
reloadalpha();
|
||||
break;
|
||||
#endif
|
||||
case 104: /* color reset */
|
||||
j = (narg > 1) ? atoi(strescseq.args[1]) : -1;
|
||||
|
@ -2292,6 +2301,9 @@ strhandle(void)
|
|||
xclearwin();
|
||||
tfulldirt();
|
||||
}
|
||||
|
||||
reloadalpha();
|
||||
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
|
2
toggle.h
2
toggle.h
|
@ -2,4 +2,4 @@
|
|||
#define USEXRESOURCES 1 /* Include Xresources support (0/1) */
|
||||
|
||||
/* Toggle functionality */
|
||||
#define RELOADCOLORS 0 /* Allow programs like pywal to reload colors during runtime through sequences (0/1) */
|
||||
#define RELOADCOLORS 1 /* Allow programs like pywal to reload colors during runtime through sequences (0/1) */
|
||||
|
|
8
x.c
8
x.c
|
@ -870,6 +870,14 @@ xloadcolor(int i, const char *name, Color *ncolor)
|
|||
return XftColorAllocName(xw.dpy, xw.vis, xw.cmap, name, ncolor);
|
||||
}
|
||||
|
||||
void
|
||||
reloadalpha(void)
|
||||
{
|
||||
dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * alpha);
|
||||
dc.col[defaultbg].pixel &= 0x00FFFFFF;
|
||||
dc.col[defaultbg].pixel |= (unsigned char)(0xff * alpha) << 24;
|
||||
}
|
||||
|
||||
void
|
||||
xloadcols(void)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue