]> git.neil.brown.name Git - edlib.git/commitdiff
Fix border for "search" popup.
authorNeilBrown <neil@brown.name>
Wed, 13 Jan 2016 04:56:56 +0000 (15:56 +1100)
committerNeilBrown <neil@brown.name>
Wed, 13 Jan 2016 04:56:56 +0000 (15:56 +1100)
Signed-off-by: NeilBrown <neil@brown.name>
lib-popup.c
lib-view.c

index f9f3627f240374b1077a37f3dafe089dcb7eb86b..98adb4b9baa71fc85edf0ddce382f051ff58a316 100644 (file)
@@ -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);
index fd7f51e6e18c8ff8f5bba15b84db49b798ec4e92..c86d4cde0851fdfc5e502c7b873493cf5eb0865e 100644 (file)
@@ -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) {