Infobar: Add autohide option in [tags]: Hide empty tags in tag list (Feature #24 requested by Erus)
This commit is contained in:
parent
3811d61858
commit
8c0e37cb38
@ -449,6 +449,7 @@ conf_tag_section(void)
|
|||||||
conf.colors.tagurbg = getcolor(fetch_opt_first(sec, "#DD1111", "urgent_bg").str);
|
conf.colors.tagurbg = getcolor(fetch_opt_first(sec, "#DD1111", "urgent_bg").str);
|
||||||
conf.colors.tag_occupied_bg = getcolor(fetch_opt_first(sec, "#222222", "occupied_bg").str);
|
conf.colors.tag_occupied_bg = getcolor(fetch_opt_first(sec, "#222222", "occupied_bg").str);
|
||||||
conf.border.tag = fetch_opt_first(sec, "false", "border").bool;
|
conf.border.tag = fetch_opt_first(sec, "false", "border").bool;
|
||||||
|
conf.tagautohide = fetch_opt_first(sec, "false", "autohide").bool;
|
||||||
|
|
||||||
/* Mouse button action on tag */
|
/* Mouse button action on tag */
|
||||||
conf.mouse_tag_action[TagSel] =
|
conf.mouse_tag_action[TagSel] =
|
||||||
|
|||||||
@ -156,6 +156,9 @@ infobar_draw(int sc)
|
|||||||
void
|
void
|
||||||
infobar_draw_layout(int sc)
|
infobar_draw_layout(int sc)
|
||||||
{
|
{
|
||||||
|
if(!conf.layout_placement)
|
||||||
|
barwin_move(infobar[sc].layout_button, infobar[sc].tags_board->geo.width + PAD / 2, 0);
|
||||||
|
|
||||||
barwin_resize(infobar[sc].layout_button, textw(tags[sc][seltag[sc]].layout.symbol) + PAD, infobar[sc].geo.height);
|
barwin_resize(infobar[sc].layout_button, textw(tags[sc][seltag[sc]].layout.symbol) + PAD, infobar[sc].geo.height);
|
||||||
barwin_refresh_color(infobar[sc].layout_button);
|
barwin_refresh_color(infobar[sc].layout_button);
|
||||||
|
|
||||||
@ -216,7 +219,7 @@ infobar_draw_selbar(int sc)
|
|||||||
void
|
void
|
||||||
infobar_draw_taglist(int sc)
|
infobar_draw_taglist(int sc)
|
||||||
{
|
{
|
||||||
int i;
|
int i, x;
|
||||||
Client *c;
|
Client *c;
|
||||||
Bool is_occupied[MAXTAG];
|
Bool is_occupied[MAXTAG];
|
||||||
|
|
||||||
@ -230,8 +233,29 @@ infobar_draw_taglist(int sc)
|
|||||||
if(c->screen == sc)
|
if(c->screen == sc)
|
||||||
is_occupied[c->tag] = True;
|
is_occupied[c->tag] = True;
|
||||||
|
|
||||||
for(i = 1; i < conf.ntag[sc] + 1; ++i)
|
for(i = 1, x = 0; i < conf.ntag[sc] + 1; ++i)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/* Autohide tag feature */
|
||||||
|
if(conf.tagautohide)
|
||||||
|
{
|
||||||
|
if(!is_occupied[i] && i != seltag[sc])
|
||||||
|
{
|
||||||
|
barwin_unmap(infobar[sc].tags[i]);
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!infobar[sc].tags[i]->mapped)
|
||||||
|
barwin_map(infobar[sc].tags[i]);
|
||||||
|
|
||||||
|
barwin_move(infobar[sc].tags[i], x, 0);
|
||||||
|
|
||||||
|
x += infobar[sc].tags[i]->geo.width;
|
||||||
|
|
||||||
|
barwin_resize(infobar[sc].tags_board, x, infobar[sc].geo.height);
|
||||||
|
}
|
||||||
|
|
||||||
infobar[sc].tags[i]->bg = tags[sc][i].urgent
|
infobar[sc].tags[i]->bg = tags[sc][i].urgent
|
||||||
? conf.colors.tagurbg
|
? conf.colors.tagurbg
|
||||||
: ((i == seltag[sc] || tags[sc][seltag[sc]].tagad & TagFlag(i))
|
: ((i == seltag[sc] || tags[sc][seltag[sc]].tagad & TagFlag(i))
|
||||||
|
|||||||
@ -343,6 +343,7 @@ typedef struct
|
|||||||
Bool focus_fmouse;
|
Bool focus_fmouse;
|
||||||
Bool focus_pclick;
|
Bool focus_pclick;
|
||||||
Bool ignore_next_client_rules;
|
Bool ignore_next_client_rules;
|
||||||
|
Bool tagautohide;
|
||||||
uint pad;
|
uint pad;
|
||||||
int status_timing;
|
int status_timing;
|
||||||
char *status_path;
|
char *status_path;
|
||||||
|
|||||||
@ -74,6 +74,9 @@
|
|||||||
# Border around the tag buttons.
|
# Border around the tag buttons.
|
||||||
border = true
|
border = true
|
||||||
|
|
||||||
|
# Hide empty tags in tag list
|
||||||
|
autohide = false
|
||||||
|
|
||||||
# Mouse buttons action on tag.
|
# Mouse buttons action on tag.
|
||||||
mouse_button_tag_sel = "1"
|
mouse_button_tag_sel = "1"
|
||||||
mouse_button_tag_transfert = "2"
|
mouse_button_tag_transfert = "2"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user