diff --git a/src/config.c b/src/config.c index 7b7dad3..7de9a78 100644 --- a/src/config.c +++ b/src/config.c @@ -449,6 +449,7 @@ conf_tag_section(void) 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.border.tag = fetch_opt_first(sec, "false", "border").bool; + conf.tagautohide = fetch_opt_first(sec, "false", "autohide").bool; /* Mouse button action on tag */ conf.mouse_tag_action[TagSel] = diff --git a/src/infobar.c b/src/infobar.c index ba33c2b..c3bf260 100644 --- a/src/infobar.c +++ b/src/infobar.c @@ -156,6 +156,9 @@ infobar_draw(int sc) void 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_refresh_color(infobar[sc].layout_button); @@ -216,7 +219,7 @@ infobar_draw_selbar(int sc) void infobar_draw_taglist(int sc) { - int i; + int i, x; Client *c; Bool is_occupied[MAXTAG]; @@ -230,8 +233,29 @@ infobar_draw_taglist(int sc) if(c->screen == sc) 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 ? conf.colors.tagurbg : ((i == seltag[sc] || tags[sc][seltag[sc]].tagad & TagFlag(i)) diff --git a/src/structs.h b/src/structs.h index 4f123b5..9dcaade 100644 --- a/src/structs.h +++ b/src/structs.h @@ -343,6 +343,7 @@ typedef struct Bool focus_fmouse; Bool focus_pclick; Bool ignore_next_client_rules; + Bool tagautohide; uint pad; int status_timing; char *status_path; diff --git a/wmfsrc.in b/wmfsrc.in index 3396c20..436da40 100644 --- a/wmfsrc.in +++ b/wmfsrc.in @@ -74,6 +74,9 @@ # Border around the tag buttons. border = true + # Hide empty tags in tag list + autohide = false + # Mouse buttons action on tag. mouse_button_tag_sel = "1" mouse_button_tag_transfert = "2"