From patchwork Thu Jun 15 04:54:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Mendoza-Jonas X-Patchwork-Id: 776110 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wpB4l1sjTz9s65 for ; Thu, 15 Jun 2017 14:54:47 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="BXUJ7Gx9"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3wpB4l0j0XzDqLM for ; Thu, 15 Jun 2017 14:54:47 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="BXUJ7Gx9"; dkim-atps=neutral X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Received: from mendozajonas.com (mendozajonas.com [188.166.185.233]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wpB4f1GC0zDqL9 for ; Thu, 15 Jun 2017 14:54:42 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="BXUJ7Gx9"; dkim-atps=neutral Received: from v4.ozlabs.ibm.com (unknown [122.99.82.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: sam@mendozajonas.com) by mendozajonas.com (Postfix) with ESMTPSA id A0BAC1441AA; Thu, 15 Jun 2017 12:54:38 +0800 (SGT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mendozajonas.com; s=mail; t=1497502479; bh=h8GknArnKLOBTJyDgoeQG0zj38P5eDVlr/rE7FFSwNk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BXUJ7Gx9oE+01ooPDcumS7OjEk6jfjWpWDrEUj/E3HO3XefUrgGtC/H5CtvYjAtHj 1LVcipE3K3X38Xm5FoGQ0aDI8ZRnJ5QuWBR3yGAYOJpRE+WKcwQsKoor0tNI1SFt5p w3peb6VR8iTjWOR+PEiq1icklGc61unsP1deDtT0= From: Samuel Mendoza-Jonas To: petitboot@lists.ozlabs.org Subject: [PATCH 1/4] ui/ncurses: Extend nc-subset pad height Date: Thu, 15 Jun 2017 14:54:28 +1000 Message-Id: <20170615045431.29572-2-sam@mendozajonas.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170615045431.29572-1-sam@mendozajonas.com> References: <20170615045431.29572-1-sam@mendozajonas.com> X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Mendoza-Jonas MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" The nc-subset screen can exceed its maximum height if some options are long enough to wrap around to two lines. Increaes the maximum size of the pad to account for every line potentially wrapping once. Signed-off-by: Samuel Mendoza-Jonas --- ui/ncurses/nc-subset.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/ncurses/nc-subset.c b/ui/ncurses/nc-subset.c index 8336725..50e1b65 100644 --- a/ui/ncurses/nc-subset.c +++ b/ui/ncurses/nc-subset.c @@ -222,8 +222,11 @@ static void subset_screen_draw(struct subset_screen *screen) bool repost = false; int height; - /* Size of pad = top space + number of available options */ - height = 1 + N_FIELDS + widget_subset_n_inactive(screen->options); + /* + * Size of pad = top space + 2 * number of available options in case + * device names wrap + */ + height = 1 + N_FIELDS + widget_subset_n_inactive(screen->options) * 2; if (!screen->pad || getmaxy(screen->pad) < height) { if (screen->pad)