Splitting SchemeHid to SchemeHidNorm and SchemeHidSel given that a hidden client may still be the selected client ref. #148

This commit is contained in:
bakkeby 2021-05-21 10:16:49 +02:00
parent 9a0fb6c83b
commit 9072ef28a4
6 changed files with 36 additions and 23 deletions

View File

@ -107,8 +107,9 @@ static const char *fonts[] = { "monospace:size=10" };
#endif // BAR_PANGO_PATCH
static const char dmenufont[] = "monospace:size=10";
#if BAR_FLEXWINTITLE_PATCH
static char c000000[] = "#000000"; // placeholder value
#if BAR_FLEXWINTITLE_PATCH
#endif // BAR_FLEXWINTITLE_PATCH
static char normfgcolor[] = "#bbbbbb";
static char normbgcolor[] = "#222222";
@ -140,10 +141,10 @@ static char tagsselbgcolor[] = "#005577";
static char tagsselbordercolor[] = "#005577";
static char tagsselfloatcolor[] = "#005577";
static char hidfgcolor[] = "#005577";
static char hidbgcolor[] = "#222222";
static char hidbordercolor[] = "#005577";
static char hidfloatcolor[] = "#f76e0c";
static char hidnormfgcolor[] = "#005577";
static char hidselfgcolor[] = "#227799";
static char hidnormbgcolor[] = "#222222";
static char hidselbgcolor[] = "#222222";
static char urgfgcolor[] = "#bbbbbb";
static char urgbgcolor[] = "#222222";
@ -197,7 +198,8 @@ static const unsigned int alphas[][3] = {
[SchemeTitleSel] = { OPAQUE, baralpha, borderalpha },
[SchemeTagsNorm] = { OPAQUE, baralpha, borderalpha },
[SchemeTagsSel] = { OPAQUE, baralpha, borderalpha },
[SchemeHid] = { OPAQUE, baralpha, borderalpha },
[SchemeHidNorm] = { OPAQUE, baralpha, borderalpha },
[SchemeHidSel] = { OPAQUE, baralpha, borderalpha },
[SchemeUrg] = { OPAQUE, baralpha, borderalpha },
#if BAR_FLEXWINTITLE_PATCH
[SchemeFlexActTTB] = { OPAQUE, baralpha, borderalpha },
@ -247,7 +249,8 @@ static const int color_ptrs[][ColCount] = {
[SchemeTitleSel] = { 6, -1, -1, -1 },
[SchemeTagsNorm] = { 2, 0, 0, -1 },
[SchemeTagsSel] = { 6, 5, 5, -1 },
[SchemeHid] = { 5, 0, 0, -1 },
[SchemeHidNorm] = { 5, 0, 0, -1 },
[SchemeHidSel] = { 6, -1, -1, -1 },
[SchemeUrg] = { 7, 9, 9, 15 },
};
#endif // BAR_VTCOLORS_PATCH
@ -260,7 +263,8 @@ static char *colors[][ColCount] = {
[SchemeTitleSel] = { titleselfgcolor, titleselbgcolor, titleselbordercolor, titleselfloatcolor },
[SchemeTagsNorm] = { tagsnormfgcolor, tagsnormbgcolor, tagsnormbordercolor, tagsnormfloatcolor },
[SchemeTagsSel] = { tagsselfgcolor, tagsselbgcolor, tagsselbordercolor, tagsselfloatcolor },
[SchemeHid] = { hidfgcolor, hidbgcolor, hidbordercolor, hidfloatcolor },
[SchemeHidNorm] = { hidnormfgcolor, hidnormbgcolor, c000000, c000000 },
[SchemeHidSel] = { hidselfgcolor, hidselbgcolor, c000000, c000000 },
[SchemeUrg] = { urgfgcolor, urgbgcolor, urgbordercolor, urgfloatcolor },
#if BAR_FLEXWINTITLE_PATCH
[SchemeFlexActTTB] = { titleselfgcolor, actTTBbgcolor, actTTBbgcolor, c000000 },
@ -308,7 +312,8 @@ static char *statuscolors[][ColCount] = {
[SchemeTitleSel] = { titleselfgcolor, titleselbgcolor, titleselbordercolor, titleselfloatcolor },
[SchemeTagsNorm] = { tagsnormfgcolor, tagsnormbgcolor, tagsnormbordercolor, tagsnormfloatcolor },
[SchemeTagsSel] = { tagsselfgcolor, tagsselbgcolor, tagsselbordercolor, tagsselfloatcolor },
[SchemeHid] = { hidfgcolor, hidbgcolor, hidbordercolor, hidfloatcolor },
[SchemeHidNorm] = { hidnormfgcolor, hidnormbgcolor, c000000, c000000 },
[SchemeHidSel] = { hidselfgcolor, hidselbgcolor, c000000, c000000 },
[SchemeUrg] = { urgfgcolor, urgbgcolor, urgbordercolor, urgfloatcolor },
};
#endif // BAR_POWERLINE_STATUS_PATCH

3
dwm.c
View File

@ -141,7 +141,8 @@ enum {
SchemeTitleSel,
SchemeTagsNorm,
SchemeTagsSel,
SchemeHid,
SchemeHidNorm,
SchemeHidSel,
SchemeUrg,
#if BAR_FLEXWINTITLE_PATCH
SchemeFlexActTTB,

View File

@ -30,10 +30,12 @@ draw_awesomebar(Bar *bar, BarArg *a)
for (i = 0, c = bar->mon->clients; c; c = c->next, i++) {
if (!ISVISIBLE(c))
continue;
if (bar->mon->sel == c)
scm = SchemeTitleSel;
if (bar->mon->sel == c && HIDDEN(c))
scm = SchemeHidSel;
else if (HIDDEN(c))
scm = SchemeHid;
scm = SchemeHidNorm;
else if (bar->mon->sel == c)
scm = SchemeTitleSel;
else
scm = SchemeTitleNorm;

View File

@ -146,7 +146,7 @@ getschemefor(Monitor *m, int group, int activegroup)
#endif // MONOCLE_LAYOUT
return SchemeTitleNorm;
case GRP_HIDDEN:
return SchemeHid;
return SchemeHidNorm;
case GRP_FLOAT:
return (activegroup ? SchemeFlexActFloat : SchemeFlexInaFloat);
}
@ -172,10 +172,12 @@ flextitledraw(Monitor *m, Client *c, int unused, int x, int w, int tabscheme, Ar
return;
int i, nclienttags = 0, nviewtags = 0, pad = lrpad / 2;
int clientscheme = (
c == selmon->sel
? getselschemefor(tabscheme)
c == selmon->sel && HIDDEN(c)
? SchemeHidSel
: HIDDEN(c)
? SchemeHid
? SchemeHidNorm
: c == selmon->sel
? getselschemefor(tabscheme)
: c->isurgent
? SchemeUrg
: tabscheme

View File

@ -43,11 +43,14 @@ bartabdraw(Monitor *m, Client *c, int unused, int x, int w, int groupactive, Arg
int i, nclienttags = 0, nviewtags = 0, pad = lrpad / 2;
drw_setscheme(drw, scheme[
m->sel == c
? SchemeSel
#ifdef HIDDEN
&& HIDDEN(c)
? SchemeHidSel
: HIDDEN(c)
? SchemeHid
? SchemeHidNorm
: m->sel == c
#endif
? SchemeSel
: groupactive
? SchemeTitleSel
: SchemeTitleNorm

View File

@ -40,10 +40,10 @@ loadxrdb()
XRDB_LOAD_COLOR("dwm.tagsselbgcolor", tagsselbgcolor);
XRDB_LOAD_COLOR("dwm.tagsselbordercolor", tagsselbordercolor);
XRDB_LOAD_COLOR("dwm.tagsselfloatcolor", tagsselfloatcolor);
XRDB_LOAD_COLOR("dwm.hidfgcolor", hidfgcolor);
XRDB_LOAD_COLOR("dwm.hidbgcolor", hidbgcolor);
XRDB_LOAD_COLOR("dwm.hidbordercolor", hidbordercolor);
XRDB_LOAD_COLOR("dwm.hidfloatcolor", hidfloatcolor);
XRDB_LOAD_COLOR("dwm.hidnormfgcolor", hidnormfgcolor);
XRDB_LOAD_COLOR("dwm.hidnormbgcolor", hidnormbgcolor);
XRDB_LOAD_COLOR("dwm.hidselfgcolor", hidselfgcolor);
XRDB_LOAD_COLOR("dwm.hidselbgcolor", hidselbgcolor);
XRDB_LOAD_COLOR("dwm.urgfgcolor", urgfgcolor);
XRDB_LOAD_COLOR("dwm.urgbgcolor", urgbgcolor);
XRDB_LOAD_COLOR("dwm.urgbordercolor", urgbordercolor);