Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
spectrwm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix bar text vertical positioning.
[spectrwm.git]
/
spectrwm.c
diff --git
a/spectrwm.c
b/spectrwm.c
index
4ec1967
..
e976c4b
100644
(file)
--- a/
spectrwm.c
+++ b/
spectrwm.c
@@
-1394,7
+1394,8
@@
bar_print(struct swm_region *r, const char *s)
DefaultVisual(display, r->s->idx),
DefaultColormap(display, r->s->idx));
DefaultVisual(display, r->s->idx),
DefaultColormap(display, r->s->idx));
- XftDrawStringUtf8(draw, &bar_font_color, bar_font, x, bar_font->height,
+ XftDrawStringUtf8(draw, &bar_font_color, bar_font, x,
+ (HEIGHT(r->bar) + bar_font->height) / 2 - bar_font->descent,
(FcChar8 *)s, len);
XftDrawDestroy(draw);
(FcChar8 *)s, len);
XftDrawDestroy(draw);
@@
-1866,7
+1867,8
@@
bar_refresh(void)
void
bar_setup(struct swm_region *r)
{
void
bar_setup(struct swm_region *r)
{
- char *font;
+ char *font, *fontpos;
+ int count;
xcb_screen_t *screen = get_screen(r->s->idx);
uint32_t wa[3];
XRenderColor color;
xcb_screen_t *screen = get_screen(r->s->idx);
uint32_t wa[3];
XRenderColor color;
@@
-1883,7
+1885,20
@@
bar_setup(struct swm_region *r)
continue;
DNPRINTF(SWM_D_INIT, "bar_setup: try font %s\n", font);
continue;
DNPRINTF(SWM_D_INIT, "bar_setup: try font %s\n", font);
- bar_font = XftFontOpenName(display, r->s->idx, font);
+
+ count = 0;
+ fontpos = font;
+ while ((fontpos = index(fontpos, '-'))) {
+ count++;
+ fontpos++;
+ }
+
+ if (count == 14)
+ bar_font = XftFontOpenXlfd(display, r->s->idx,
+ font);
+ else
+ bar_font = XftFontOpenName(display, r->s->idx,
+ font);
if (!bar_font) {
warnx("unable to load font %s", font);
continue;
if (!bar_font) {
warnx("unable to load font %s", font);
continue;
@@
-1898,7
+1913,7
@@
bar_setup(struct swm_region *r)
if (bar_font == NULL)
errx(1, "unable to open a font");
if (bar_font == NULL)
errx(1, "unable to open a font");
- bar_height = bar_font->height + 4 * bar_border_width;
+ bar_height = bar_font->height + 2 * bar_border_width;
if (bar_height < 1)
bar_height = 1;
if (bar_height < 1)
bar_height = 1;