From: NeilBrown Date: Wed, 13 Jan 2016 04:56:56 +0000 (+1100) Subject: Fix border for "search" popup. X-Git-Tag: lca2016~19 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=f600caaff24323b37ef256b41fcf9b8d6a4e7865;p=edlib.git Fix border for "search" popup. Signed-off-by: NeilBrown --- diff --git a/lib-popup.c b/lib-popup.c index f9f3627f..98adb4b9 100644 --- a/lib-popup.c +++ b/lib-popup.c @@ -73,8 +73,8 @@ static void popup_resize(struct pane *p, char *style) /* Now position */ x = p->parent->w/2 - w/2 - 1; y = p->parent->h/2 - h/2 - 1; - if (strchr(style, 'T')) { y = 0; h -= 1; } - if (strchr(style, 'B')) { h -= 1; y = p->parent->h - h; } + if (strchr(style, 'T')) { y = 0; h -= lh; } + if (strchr(style, 'B')) { h -= lh; y = p->parent->h - h; } if (strchr(style, 'L')) x = 0; if (strchr(style, 'R')) x = p->parent->w - w; pane_resize(p, x, y, w, h); diff --git a/lib-view.c b/lib-view.c index fd7f51e6..c86d4cde 100644 --- a/lib-view.c +++ b/lib-view.c @@ -80,14 +80,19 @@ static int view_refresh(const struct cmd_info *ci) vd->border_width = cr.x; vd->ascent = cr.i; - if (p->h < vd->border_height * 3) { + if (p->h < vd->border_height * 3 && + (vd->border & (BORDER_TOP|BORDER_BOT)) == + (BORDER_TOP|BORDER_BOT)) { vd->border &= ~BORDER_TOP; vd->border &= ~BORDER_BOT; } - if (p->w < vd->border_width * 3) { + if (p->w < vd->border_width * 3 && + (vd->border & (BORDER_LEFT|BORDER_RIGHT)) == + (BORDER_LEFT|BORDER_RIGHT)) { vd->border &= ~BORDER_LEFT; vd->border &= ~BORDER_RIGHT; } + } if (vd->border & BORDER_LEFT) {