removed focuscolors again (unnecessary bloat)

This commit is contained in:
Anselm R. Garbe 2006-05-19 20:14:06 +02:00
parent 58fa7998b8
commit 1ee2585062
8 changed files with 20 additions and 44 deletions

View File

@ -46,7 +46,7 @@ create_bar(char *name, Bool intern)
b->id = id++; b->id = id++;
b->intern = intern; b->intern = intern;
cext_strlcpy(b->name, name, sizeof(b->name)); cext_strlcpy(b->name, name, sizeof(b->name));
cext_strlcpy(b->colstr, def.focuscolor, sizeof(b->colstr)); cext_strlcpy(b->colstr, def.selcolor, sizeof(b->colstr));
b->color = def.sel; b->color = def.sel;
cext_vattach(vector_of_bars(&bar), b); cext_vattach(vector_of_bars(&bar), b);
qsort(bar.data, bar.size, sizeof(Bar *), comp_bar_name); qsort(bar.data, bar.size, sizeof(Bar *), comp_bar_name);
@ -120,7 +120,7 @@ draw_bar()
b = bar.data[i]; b = bar.data[i];
if(b->intern) { if(b->intern) {
if(view.size && !strncmp(b->name, view.data[sel]->name, sizeof(b->name))) if(view.size && !strncmp(b->name, view.data[sel]->name, sizeof(b->name)))
b->color = def.focus; b->color = def.sel;
else else
b->color = def.norm; b->color = def.norm;
} }

View File

@ -273,13 +273,9 @@ draw_client(Client *c)
d.gc = c->gc; d.gc = c->gc;
if(c == sel_client()) if(c == sel_client())
d.color = def.focus; d.color = def.sel;
else { else
if(f->area->sel == fidx) d.color = def.norm;
d.color = def.sel;
else
d.color = def.norm;
}
/* draw border */ /* draw border */
if(def.border) { if(def.border) {
@ -305,10 +301,19 @@ draw_client(Client *c)
d.rect.x = f->rect.width - d.rect.width; d.rect.x = f->rect.width - d.rect.width;
d.data = buf; d.data = buf;
if(f->area->sel == fidx)
d.color = def.sel;
else
d.color = def.norm;
blitz_drawlabel(dpy, &d); blitz_drawlabel(dpy, &d);
blitz_drawborder(dpy, &d); blitz_drawborder(dpy, &d);
d.rect.x = 0; d.rect.x = 0;
if(c == sel_client())
d.color = def.sel;
else
d.color = def.norm;
/* tag bar */ /* tag bar */
d.rect.width = d.rect.height + blitz_textwidth(dpy, &blitzfont, c->tags); d.rect.width = d.rect.height + blitz_textwidth(dpy, &blitzfont, c->tags);
if(d.rect.width + w > f->rect.width) if(d.rect.width + w > f->rect.width)

View File

@ -36,7 +36,6 @@ enum { WMII_IOUNIT = 2048 };
* /def/ FsDdef * /def/ FsDdef
* /def/border FsFborder 0..n * /def/border FsFborder 0..n
* /def/font FsFfont xlib font name * /def/font FsFfont xlib font name
* /def/focuscolors FsFfocuscolors focused colors
* /def/selcolors FsFselcolors selected colors * /def/selcolors FsFselcolors selected colors
* /def/normcolors FsFnormcolors normal colors * /def/normcolors FsFnormcolors normal colors
* /def/rules FsFrules rules * /def/rules FsFrules rules
@ -197,7 +196,6 @@ name_of_qid(Qid wqid[IXP_MAX_WELEM], unsigned short qsel)
snprintf(buf, sizeof(buf), "%u", i3); snprintf(buf, sizeof(buf), "%u", i3);
return buf; return buf;
break; break;
case FsFfocuscolors: return "focuscolors"; break;
case FsFselcolors: return "selcolors"; break; case FsFselcolors: return "selcolors"; break;
case FsFnormcolors: return "normcolors"; break; case FsFnormcolors: return "normcolors"; break;
case FsFfont: return "font"; break; case FsFfont: return "font"; break;
@ -299,8 +297,6 @@ type_of_name(Qid wqid[IXP_MAX_WELEM], unsigned short qsel, char *name)
return FsFgeom; return FsFgeom;
if(!strncmp(name, "colors", 7)) if(!strncmp(name, "colors", 7))
return FsFcolors; return FsFcolors;
if(!strncmp(name, "focuscolors", 12))
return FsFfocuscolors;
if(!strncmp(name, "selcolors", 10)) if(!strncmp(name, "selcolors", 10))
return FsFselcolors; return FsFselcolors;
if(!strncmp(name, "normcolors", 11)) if(!strncmp(name, "normcolors", 11))
@ -461,7 +457,6 @@ qid_of_name(Qid wqid[IXP_MAX_WELEM], unsigned short qsel, char *name)
case FsFfont: case FsFfont:
case FsFcolw: case FsFcolw:
case FsFrules: case FsFrules:
case FsFfocuscolors:
case FsFselcolors: case FsFselcolors:
case FsFnormcolors: case FsFnormcolors:
case FsFkeys: case FsFkeys:
@ -614,7 +609,6 @@ stat_of_name(Stat *stat, char *name, Qid wqid[IXP_MAX_WELEM], unsigned short qse
} }
break; break;
case FsFcolors: case FsFcolors:
case FsFfocuscolors:
case FsFselcolors: case FsFselcolors:
case FsFnormcolors: case FsFnormcolors:
return pack_stat(stat, wqid, qsel, name, 23, IXP_DMREAD | IXP_DMWRITE); return pack_stat(stat, wqid, qsel, name, 23, IXP_DMREAD | IXP_DMWRITE);
@ -1055,8 +1049,6 @@ xread(IXPConn *c, Fcall *fcall)
case FsDdef: case FsDdef:
fcall->count = stat_of_name(&stat, "border", m->wqid, m->sel); fcall->count = stat_of_name(&stat, "border", m->wqid, m->sel);
p = ixp_pack_stat(p, &stat); p = ixp_pack_stat(p, &stat);
fcall->count += stat_of_name(&stat, "focuscolors", m->wqid, m->sel);
p = ixp_pack_stat(p, &stat);
fcall->count += stat_of_name(&stat, "selcolors", m->wqid, m->sel); fcall->count += stat_of_name(&stat, "selcolors", m->wqid, m->sel);
p = ixp_pack_stat(p, &stat); p = ixp_pack_stat(p, &stat);
fcall->count += stat_of_name(&stat, "normcolors", m->wqid, m->sel); fcall->count += stat_of_name(&stat, "normcolors", m->wqid, m->sel);
@ -1226,10 +1218,6 @@ xread(IXPConn *c, Fcall *fcall)
if((fcall->count = strlen(bar.data[i1]->colstr))) if((fcall->count = strlen(bar.data[i1]->colstr)))
memcpy(p, bar.data[i1]->colstr, fcall->count); memcpy(p, bar.data[i1]->colstr, fcall->count);
break; break;
case FsFfocuscolors:
if((fcall->count = strlen(def.focuscolor)))
memcpy(p, def.focuscolor, fcall->count);
break;
case FsFselcolors: case FsFselcolors:
if((fcall->count = strlen(def.selcolor))) if((fcall->count = strlen(def.selcolor)))
memcpy(p, def.selcolor, fcall->count); memcpy(p, def.selcolor, fcall->count);
@ -1430,15 +1418,6 @@ xwrite(IXPConn *c, Fcall *fcall)
blitz_loadcolor(dpy, &bar.data[i1]->color, screen, bar.data[i1]->colstr); blitz_loadcolor(dpy, &bar.data[i1]->color, screen, bar.data[i1]->colstr);
draw_bar(); draw_bar();
break; break;
case FsFfocuscolors:
if((fcall->count != 23) || (fcall->data[0] != '#')
|| (fcall->data[8] != '#') || (fcall->data[16] != '#'))
return Ebadvalue;
memcpy(def.focuscolor, fcall->data, fcall->count);
def.focuscolor[fcall->count] = 0;
blitz_loadcolor(dpy, &def.focus, screen, def.focuscolor);
draw_clients();
break;
case FsFselcolors: case FsFselcolors:
if((fcall->count != 23) || (fcall->data[0] != '#') if((fcall->count != 23) || (fcall->data[0] != '#')
|| (fcall->data[8] != '#') || (fcall->data[16] != '#')) || (fcall->data[8] != '#') || (fcall->data[16] != '#'))

View File

@ -143,7 +143,7 @@ init_screen()
gcv.subwindow_mode = IncludeInferiors; gcv.subwindow_mode = IncludeInferiors;
gcv.function = GXxor; gcv.function = GXxor;
gcv.foreground = def.focus.bg; gcv.foreground = def.sel.bg;
gcv.plane_mask = AllPlanes; gcv.plane_mask = AllPlanes;
gcv.graphics_exposures = False; gcv.graphics_exposures = False;
xorgc = XCreateGC(dpy, root, GCForeground | GCGraphicsExposures xorgc = XCreateGC(dpy, root, GCForeground | GCGraphicsExposures
@ -303,8 +303,6 @@ main(int argc, char *argv[])
def.border = 2; def.border = 2;
def.colmode = Coldefault; def.colmode = Coldefault;
def.colw = 0; def.colw = 0;
cext_strlcpy(def.focuscolor, BLITZ_FOCUSCOLORS, sizeof(def.focuscolor));
blitz_loadcolor(dpy, &def.focus, screen, def.focuscolor);
cext_strlcpy(def.selcolor, BLITZ_SELCOLORS, sizeof(def.selcolor)); cext_strlcpy(def.selcolor, BLITZ_SELCOLORS, sizeof(def.selcolor));
blitz_loadcolor(dpy, &def.sel, screen, def.selcolor); blitz_loadcolor(dpy, &def.sel, screen, def.selcolor);
cext_strlcpy(def.normcolor, BLITZ_NORMCOLORS, sizeof(def.normcolor)); cext_strlcpy(def.normcolor, BLITZ_NORMCOLORS, sizeof(def.normcolor));

View File

@ -54,7 +54,6 @@ enum {
FsFdata, FsFdata,
FsFcolors, FsFcolors,
FsFfont, FsFfont,
FsFfocuscolors,
FsFselcolors, FsFselcolors,
FsFnormcolors, FsFnormcolors,
FsFkeys, FsFkeys,
@ -150,11 +149,9 @@ typedef struct {
/* default values */ /* default values */
typedef struct { typedef struct {
char focuscolor[24];
char selcolor[24]; char selcolor[24];
char normcolor[24]; char normcolor[24];
char *font; char *font;
BlitzColor focus;
BlitzColor sel; BlitzColor sel;
BlitzColor norm; BlitzColor norm;
unsigned int border; unsigned int border;

View File

@ -364,9 +364,9 @@ main(int argc, char *argv[])
if (!normcolstr || strlen(normcolstr) != 23) if (!normcolstr || strlen(normcolstr) != 23)
normcolstr = strdup(BLITZ_NORMCOLORS); normcolstr = strdup(BLITZ_NORMCOLORS);
blitz_loadcolor(dpy, &normcolor, screen, normcolstr); blitz_loadcolor(dpy, &normcolor, screen, normcolstr);
selcolstr = getenv("WMII_FOCUSCOLORS"); selcolstr = getenv("WMII_SELCOLORS");
if (!selcolstr || strlen(selcolstr) != 23) if (!selcolstr || strlen(selcolstr) != 23)
selcolstr = strdup(BLITZ_FOCUSCOLORS); selcolstr = strdup(BLITZ_SELCOLORS);
blitz_loadcolor(dpy, &selcolor, screen, selcolstr); blitz_loadcolor(dpy, &selcolor, screen, selcolstr);
wa.override_redirect = 1; wa.override_redirect = 1;

View File

@ -7,8 +7,7 @@
#include <X11/Xlocale.h> #include <X11/Xlocale.h>
#define BLITZ_FONT "fixed" #define BLITZ_FONT "fixed"
#define BLITZ_FOCUSCOLORS "#ffffff #335577 #447799" #define BLITZ_SELCOLORS "#ffffff #335577 #447799"
#define BLITZ_SELCOLORS "#ffffff #112233 #224466"
#define BLITZ_NORMCOLORS "#222222 #eeeeee #666666" #define BLITZ_NORMCOLORS "#222222 #eeeeee #666666"
/* /*

View File

@ -17,13 +17,12 @@ LEFT=h
RIGHT=l RIGHT=l
WMII_FONT='fixed' WMII_FONT='fixed'
WMII_FOCUSCOLORS='#ffffff #335577 #447799' WMII_SELCOLORS='#ffffff #335577 #447799'
WMII_SELCOLORS='#ffffff #112233 #224466'
WMII_NORMCOLORS='#222222 #eeeeee #666666' WMII_NORMCOLORS='#222222 #eeeeee #666666'
# dark background # dark background
#WMII_NORMCOLORS='#eeeeee #111111 #222222' #WMII_NORMCOLORS='#eeeeee #111111 #222222'
export WMII_FONT WMII_FOCUSCOLORS WMII_SELCOLORS WMII_NORMCOLORS export WMII_FONT WMII_SELCOLORS WMII_NORMCOLORS
# give wmiiwm a chance to start # give wmiiwm a chance to start
while : while :
@ -35,7 +34,6 @@ done
# WM CONFIGURATION # WM CONFIGURATION
xwrite /def/border 2 xwrite /def/border 2
xwrite /def/font $WMII_FONT xwrite /def/font $WMII_FONT
xwrite /def/focuscolors $WMII_FOCUSCOLORS
xwrite /def/selcolors $WMII_SELCOLORS xwrite /def/selcolors $WMII_SELCOLORS
xwrite /def/normcolors $WMII_NORMCOLORS xwrite /def/normcolors $WMII_NORMCOLORS
xwrite /def/colmode default xwrite /def/colmode default