diff options
| author | bakkeby <[email protected]> | 2020-08-22 16:25:56 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2020-08-22 16:25:56 +0200 |
| commit | 32819a48f3efb57c010d3d27c6b2a537916793b2 (patch) | |
| tree | 5d3b1d5436ea37504f62f9f3b56cbe16a69711a3 /patch/bar_awesomebar.c | |
| parent | 512a656ddddc588b2d406f344cfc160c9c2c81b5 (diff) | |
| download | dwm-flexipatch-32819a48f3efb57c010d3d27c6b2a537916793b2.tar.gz dwm-flexipatch-32819a48f3efb57c010d3d27c6b2a537916793b2.zip | |
Added clientindicators patch and unified and simplified indicator code. Enabled centeredwindowname option for awesomebar and bartabgroups patches.
Diffstat (limited to 'patch/bar_awesomebar.c')
| -rw-r--r-- | patch/bar_awesomebar.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/patch/bar_awesomebar.c b/patch/bar_awesomebar.c index 750c99a..00bb9e8 100644 --- a/patch/bar_awesomebar.c +++ b/patch/bar_awesomebar.c @@ -7,7 +7,7 @@ width_awesomebar(Bar *bar, BarWidthArg *a) int draw_awesomebar(Bar *bar, BarDrawArg *a) { - int n = 0, scm, remainder = 0, tabw; + int n = 0, scm, remainder = 0, tabw, pad; unsigned int i; #if BAR_TITLE_LEFT_PAD && BAR_TITLE_RIGHT_PAD int x = a->x + lrpad / 2, w = a->w - lrpad; @@ -37,12 +37,20 @@ draw_awesomebar(Bar *bar, BarDrawArg *a) else scm = SchemeTitleNorm; + pad = lrpad / 2; + #if BAR_CENTEREDWINDOWNAME_PATCH + if (TEXTW(c->name) < w) + pad = (tabw - TEXTW(c->name) + lrpad) / 2; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + drw_setscheme(drw, scheme[scm]); #if BAR_PANGO_PATCH - drw_text(drw, x, 0, tabw + (i < remainder ? 1 : 0), bh, lrpad / 2, c->name, 0, False); + drw_text(drw, x, 0, tabw + (i < remainder ? 1 : 0), bh, pad, c->name, 0, False); #else - drw_text(drw, x, 0, tabw + (i < remainder ? 1 : 0), bh, lrpad / 2, c->name, 0); + drw_text(drw, x, 0, tabw + (i < remainder ? 1 : 0), bh, pad, c->name, 0); #endif // BAR_PANGO_PATCH + if (c->isfloating) + drawindicator(c->mon, c, 1, x, w, 0, 0, c->isfixed, floatindicatortype); x += tabw + (i < remainder ? 1 : 0); } } |
