display layout nmaster/ncols vars in new tags without clients

This commit is contained in:
Julien Danjou 2007-09-24 17:08:47 +02:00
parent b5f2129680
commit 89fa270bca
1 changed files with 10 additions and 0 deletions

View File

@ -19,11 +19,14 @@
* *
*/ */
#include <stdio.h>
#include "layout.h" #include "layout.h"
#include "statusbar.h" #include "statusbar.h"
#include "draw.h" #include "draw.h"
#include "screen.h" #include "screen.h"
#include "util.h" #include "util.h"
#include "layouts/tile.h"
extern Client *clients, *sel, *stack; /* global client list and stack */ extern Client *clients, *sel, *stack; /* global client list and stack */
@ -48,6 +51,7 @@ void
drawstatusbar(Display *disp, DC *drawcontext, awesome_config * awesomeconf) drawstatusbar(Display *disp, DC *drawcontext, awesome_config * awesomeconf)
{ {
int x, i; int x, i;
drawcontext->x = drawcontext->y = 0; drawcontext->x = drawcontext->y = 0;
for(i = 0; i < awesomeconf->ntags; i++) for(i = 0; i < awesomeconf->ntags; i++)
{ {
@ -86,6 +90,12 @@ drawstatusbar(Display *disp, DC *drawcontext, awesome_config * awesomeconf)
if(sel->isfloating) if(sel->isfloating)
drawsquare(disp, *drawcontext, awesomeconf->statusbar.drawable, sel->ismax, drawcontext->sel[ColFG]); drawsquare(disp, *drawcontext, awesomeconf->statusbar.drawable, sel->ismax, drawcontext->sel[ColFG]);
} }
else if(IS_ARRANGE(layout_tile) || IS_ARRANGE(layout_tileleft))
{
char buf[256];
snprintf(buf, sizeof(buf), "nmaster: %d ncols: %d", awesomeconf->nmaster, awesomeconf->ncols);
drawtext(disp, *drawcontext, awesomeconf->statusbar.drawable, buf, drawcontext->norm);
}
else else
drawtext(disp, *drawcontext, awesomeconf->statusbar.drawable, NULL, drawcontext->norm); drawtext(disp, *drawcontext, awesomeconf->statusbar.drawable, NULL, drawcontext->norm);
} }