summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch')
-rw-r--r--patch/status2d.c26
-rw-r--r--patch/statuscolors.c4
2 files changed, 30 insertions, 0 deletions
diff --git a/patch/status2d.c b/patch/status2d.c
index 261a572..936b21a 100644
--- a/patch/status2d.c
+++ b/patch/status2d.c
@@ -24,7 +24,11 @@ drawstatusbar(Monitor *m, int bh, char* stext, int stw, int stp)
if (!isCode) {
isCode = 1;
text[i] = '\0';
+ #if PANGO_PATCH
+ w += TEXTWM(text) - lrpad;
+ #else
w += TEXTW(text) - lrpad;
+ #endif // PANGO_PATCH
text[i] = '^';
if (text[++i] == 'f')
w += atoi(text + ++i);
@@ -36,7 +40,11 @@ drawstatusbar(Monitor *m, int bh, char* stext, int stw, int stp)
}
}
if (!isCode)
+ #if PANGO_PATCH
+ w += TEXTWM(text) - lrpad;
+ #else
w += TEXTW(text) - lrpad;
+ #endif // PANGO_PATCH
else
isCode = 0;
text = p;
@@ -57,8 +65,13 @@ drawstatusbar(Monitor *m, int bh, char* stext, int stw, int stp)
isCode = 1;
text[i] = '\0';
+ #if PANGO_PATCH
+ w = TEXTWM(text) - lrpad;
+ drw_text(drw, x, 0, w, bh, 0, text, 0, True);
+ #else
w = TEXTW(text) - lrpad;
drw_text(drw, x, 0, w, bh, 0, text, 0);
+ #endif // PANGO_PATCH
x += w;
@@ -126,8 +139,13 @@ drawstatusbar(Monitor *m, int bh, char* stext, int stw, int stp)
}
if (!isCode) {
+ #if PANGO_PATCH
+ w = TEXTWM(text) - lrpad;
+ drw_text(drw, x, 0, w, bh, 0, text, 0, True);
+ #else
w = TEXTW(text) - lrpad;
drw_text(drw, x, 0, w, bh, 0, text, 0);
+ #endif // PANGO_PATCH
}
drw_setscheme(drw, scheme[SchemeNorm]);
@@ -161,7 +179,11 @@ status2dtextlength(char* stext)
if (!isCode) {
isCode = 1;
text[i] = '\0';
+ #if PANGO_PATCH
+ w += TEXTWM(text) - lrpad;
+ #else
w += TEXTW(text) - lrpad;
+ #endif // PANGO_PATCH
text[i] = '^';
if (text[++i] == 'f')
w += atoi(text + ++i);
@@ -173,7 +195,11 @@ status2dtextlength(char* stext)
}
}
if (!isCode)
+ #if PANGO_PATCH
+ w += TEXTWM(text) - lrpad;
+ #else
w += TEXTW(text) - lrpad;
+ #endif // PANGO_PATCH
else
isCode = 0;
return w;
diff --git a/patch/statuscolors.c b/patch/statuscolors.c
index 2f015ad..ef41735 100644
--- a/patch/statuscolors.c
+++ b/patch/statuscolors.c
@@ -12,7 +12,11 @@ textw_wosc(char *s)
}
ctmp = *ts;
*ts = '\0';
+ #if PANGO_PATCH
+ sw += drw_font_getwidth(drw, tp, True);
+ #else
sw += drw_fontset_getwidth(drw, tp);
+ #endif // PANGO_PATCH
*ts = ctmp;
if (ctmp == '\0')
break;