diff --git a/src/infobar.c b/src/infobar.c index b687d9e..6d6266f 100644 --- a/src/infobar.c +++ b/src/infobar.c @@ -32,6 +32,8 @@ #include "wmfs.h" +#define SPLIT_IND_S (3 + conf.border.layout) + /** Init the Infobar */ void @@ -138,15 +140,27 @@ infobar_init(void) /** Draw the layout button in the InfoBar *\param sc Screen number */ -static void +void infobar_draw_layout(int sc) { + int w; + if(!conf.layout_placement) barwin_move(infobar[sc].layout_button, infobar[sc].tags_board->geo.width + (PAD >> 1), 0); - barwin_resize(infobar[sc].layout_button, ((conf.layout_button_width > 0) ? (uint)conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)), infobar[sc].geo.height); + w = ((conf.layout_button_width > 0) ? (uint)conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)); + + barwin_resize(infobar[sc].layout_button, w, infobar[sc].geo.height); barwin_refresh_color(infobar[sc].layout_button); + /* Split mode indicator; little rectangle at bottom-right */ + if(tags[sc][seltag[sc]].flags & SplitFlag) + draw_rectangle(infobar[sc].layout_button->dr, + w - SPLIT_IND_S, + infobar[sc].geo.height - SPLIT_IND_S, + SPLIT_IND_S, SPLIT_IND_S, + getcolor(infobar[sc].layout_button->fg)); + if(tags[sc][seltag[sc]].layout.symbol) barwin_draw_text(infobar[sc].layout_button, (PAD >> 1), FHINFOBAR, tags[sc][seltag[sc]].layout.symbol); diff --git a/src/split.c b/src/split.c index 64361ec..35f8ba7 100644 --- a/src/split.c +++ b/src/split.c @@ -362,6 +362,7 @@ uicb_split_toggle(uicb_t cmd) tags[selscreen][seltag[selscreen]].flags ^= SplitFlag; layout_func(selscreen, seltag[selscreen]); + infobar_draw_layout(selscreen); return; } diff --git a/src/wmfs.h b/src/wmfs.h index 17e3693..1332b8e 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -145,6 +145,7 @@ ushort textw(char *text); /* infobar.c */ void infobar_init(void); +void infobar_draw_layout(int sc); void infobar_draw(int sc); void infobar_draw_selbar(int sc); void infobar_draw_taglist(int sc);