diff options
| author | bakkeby <[email protected]> | 2020-07-15 09:26:16 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2020-07-15 09:26:16 +0200 |
| commit | f2da4d20d9a79070863972423ca964cf65342ba7 (patch) | |
| tree | 9bbc68308ada0a1d28c231a822ce4a103cdeb8f7 /patch/bar_statuscolors.c | |
| parent | 903b32ac8b4a69b37981874f23b15a9f65f2a20d (diff) | |
| download | dwm-flexipatch-f2da4d20d9a79070863972423ca964cf65342ba7.tar.gz dwm-flexipatch-f2da4d20d9a79070863972423ca964cf65342ba7.zip | |
Further bar renaming
Diffstat (limited to 'patch/bar_statuscolors.c')
| -rw-r--r-- | patch/bar_statuscolors.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/patch/bar_statuscolors.c b/patch/bar_statuscolors.c new file mode 100644 index 0000000..cc24ad4 --- /dev/null +++ b/patch/bar_statuscolors.c @@ -0,0 +1,27 @@ +int +textw_wosc(char *s) +{ + char *ts = s; + char *tp = s; + int sw = 0; + char ctmp; + while (1) { + if ((unsigned int)*ts > LENGTH(colors)) { + ts++; + continue; + } + ctmp = *ts; + *ts = '\0'; + #if BAR_PANGO_PATCH + sw += drw_font_getwidth(drw, tp, True); + #else + sw += drw_fontset_getwidth(drw, tp); + #endif // BAR_PANGO_PATCH + *ts = ctmp; + if (ctmp == '\0') + break; + tp = ++ts; + } + + return sw; +}
\ No newline at end of file |
