all,layout: Add layout right separation and surface structure

This commit is contained in:
Martin Duquesnoy 2008-10-28 19:16:18 +01:00
parent add0f0187b
commit 38dfecf837
4 changed files with 18 additions and 25 deletions

View File

@ -141,8 +141,6 @@ updatebar(void)
void void
uicb_togglebarpos(uicb_t cmd) uicb_togglebarpos(uicb_t cmd)
{ {
int i;
conf.bartop = !conf.bartop; conf.bartop = !conf.bartop;
if(conf.bartop) if(conf.bartop)
sgeo.y = conf.titlebar.pos ? barheight : barheight + conf.titlebar.height; sgeo.y = conf.titlebar.pos ? barheight : barheight + conf.titlebar.height;
@ -155,11 +153,6 @@ uicb_togglebarpos(uicb_t cmd)
bary = mh - barheight; bary = mh - barheight;
bar_moveresize(bar, 0, bary, mw, barheight); bar_moveresize(bar, 0, bary, mw, barheight);
updatebar(); updatebar();
for(i = 0; i < conf.nbutton; ++i)
XUnmapWindow(dpy, conf.barbutton[i].bw->win);
for(i = 0; i < conf.nbutton; ++i)
XMapWindow(dpy, conf.barbutton[i].bw->win);
arrange(); arrange();
return; return;

View File

@ -78,7 +78,7 @@ draw_taglist(Drawable dr)
((i+1 == seltag) ? conf.colors.tagselfg : conf.colors.text), ((i+1 == seltag) ? conf.colors.tagselfg : conf.colors.text),
((i+1 == seltag) ? conf.colors.tagselbg : conf.colors.bar), PAD, buf[i]); ((i+1 == seltag) ? conf.colors.tagselbg : conf.colors.bar), PAD, buf[i]);
/* Draw the tag border */ /* Draw the tag separation */
draw_rectangle(dr, taglen[i] + textw(buf[i]) + PAD/2, draw_rectangle(dr, taglen[i] + textw(buf[i]) + PAD/2,
0, conf.tagbordwidth, barheight, conf.colors.tagbord); 0, conf.tagbordwidth, barheight, conf.colors.tagbord);
@ -92,11 +92,17 @@ draw_taglist(Drawable dr)
void void
draw_layout(void) draw_layout(void)
{ {
draw_text(bar->dr, taglen[conf.ntag] + 1, fonth, /* Draw layout name / symbol */
draw_text(bar->dr, taglen[conf.ntag], fonth,
conf.colors.layout_fg, conf.colors.layout_fg,
conf.colors.layout_bg, conf.colors.layout_bg,
2, tags[seltag].layout.symbol); 2, tags[seltag].layout.symbol);
/* Draw right separation */
draw_rectangle(bar->dr,
taglen[conf.ntag] + textw(tags[seltag].layout.symbol) + PAD/2,
0, conf.tagbordwidth, barheight, conf.colors.tagbord);
return; return;
} }

View File

@ -112,17 +112,18 @@ typedef struct
uicb_t cmd; uicb_t cmd;
} MouseBinding; } MouseBinding;
/* Bar Button */ /* Surface \o/ */
typedef struct typedef struct
{ {
char *content; char *text;
BarWindow *bw; Drawable dr;
char *fg_color; Window win;
int bg_color; XRectangle geo;
uint x; MouseBinding mousebind[10];
int nmousesec; int nmouse;
MouseBinding mouse[NBUTTON]; char *fg;
} BarButton; uint bg;
} Surface;
/* Layout Structure */ /* Layout Structure */
typedef struct typedef struct
@ -191,7 +192,6 @@ typedef struct
} titlebar; } titlebar;
Tag tag[MAXTAG]; Tag tag[MAXTAG];
Layout layout[MAXLAYOUT]; Layout layout[MAXLAYOUT];
BarButton *barbutton;
int ntag; int ntag;
int nkeybind; int nkeybind;
int nbutton; int nbutton;

View File

@ -87,18 +87,12 @@ errorhandlerstart(Display *d, XErrorEvent *event)
void void
quit(void) quit(void)
{ {
int i;
/* Exiting WMFS :'( */ /* Exiting WMFS :'( */
XftFontClose(dpy, xftfont); XftFontClose(dpy, xftfont);
XFreeCursor(dpy, cursor[CurNormal]); XFreeCursor(dpy, cursor[CurNormal]);
XFreeCursor(dpy, cursor[CurMove]); XFreeCursor(dpy, cursor[CurMove]);
XFreeCursor(dpy, cursor[CurResize]); XFreeCursor(dpy, cursor[CurResize]);
bar_delete(bar); bar_delete(bar);
if(conf.nbutton)
for(i = 0; i < conf.nbutton; ++i)
bar_delete(conf.barbutton[i].bw);
efree(conf.barbutton);
efree(keys); efree(keys);
efree(conf.titlebar.mouse); efree(conf.titlebar.mouse);
efree(conf.client.mouse); efree(conf.client.mouse);