From patchwork Sun Dec 7 20:16:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 830 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138683; bh=fUJOzwsAjaSVi5piLi4vBY6E+Vct2ierlIMMF3lnnP8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Atifbwl7RmoPSuM67F43P1mSzJ4US7U+fuFmH+Prd8BZ1/BJeNIXFQuCLplzXX/tY /HH0gPDmjK28bI2UbKEVZxeLMQfNtW4V36V7xC+nBnZlOyWZ9zw6XJHzReLCPsMq/o 20z8Ei6Gcyz8m+j/Ngf+LZqXta1g+incOx2v118QjYmjv+mBrghUHWIayAeJzP1WlB 52GLsj2AD67r9Z0wBeIDKixXKAHrVTcIpzW0pt/lEgnB2uhE8PKMhCCTL8U7hOH3g3 lLCGsXWBCU+Tkmk7r5un/PwTXWhgj33/ir5St75GAUm5OafdI0j94GSYUjpovVoD4W kZ4UT2sCzH4lw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EB5B5689B3 for ; Sun, 7 Dec 2025 13:18:03 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id n8H-EInpjzpB for ; Sun, 7 Dec 2025 13:18:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138683; bh=fUJOzwsAjaSVi5piLi4vBY6E+Vct2ierlIMMF3lnnP8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Atifbwl7RmoPSuM67F43P1mSzJ4US7U+fuFmH+Prd8BZ1/BJeNIXFQuCLplzXX/tY /HH0gPDmjK28bI2UbKEVZxeLMQfNtW4V36V7xC+nBnZlOyWZ9zw6XJHzReLCPsMq/o 20z8Ei6Gcyz8m+j/Ngf+LZqXta1g+incOx2v118QjYmjv+mBrghUHWIayAeJzP1WlB 52GLsj2AD67r9Z0wBeIDKixXKAHrVTcIpzW0pt/lEgnB2uhE8PKMhCCTL8U7hOH3g3 lLCGsXWBCU+Tkmk7r5un/PwTXWhgj33/ir5St75GAUm5OafdI0j94GSYUjpovVoD4W kZ4UT2sCzH4lw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D90FE688F6 for ; Sun, 7 Dec 2025 13:18:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138681; bh=/f1nt7jMsupwPtHyEwIcI/WPi6LaDjWrvWzw35McJK4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l4MB/W1usrCPEFhu2DrYOavJYazHEbnISDysZcrsFKW06WUZz/PgOHUtw5nu5a4u5 OT8oKs/MO9pY33VxmSHdMYBr09r4dzRk7WXDlNMIPWqZYxhJPFzU68dDxxzK/+qTBu NHLS4XtSE9fCbkVUCVAIQnL1dx1f99DtxhUzgCTfqG7jJJmbm4nQQzkF9Sc69PrE2s K05Tx9Rf+eosLVifNpiYj8ZkZDTv3k7d5QJAQGE90rVhvfP4AnAmoG+EVnQ7wS96Lr U2Cg7uOSmcWlOvBLYjkwijayhKD81JyyIoyMVWwRij41ifOlmZ8W+Ehz5UV6cr5CeU spXPYnuoUupOQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 186E76883E; Sun, 7 Dec 2025 13:18:01 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id yMEJNqyiXpWp; Sun, 7 Dec 2025 13:18:01 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138677; bh=UvI2jypCGB/7bZbpQOEqeDxF8MAsxJK/VlKPhdU6Vs0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WjxvjsMakH/YL2ChbE10q+mbPNcaF0dOylcjV+Z092WdH4zkCGjwOOR5qI8Dn4j1P rehwevpw4yujkjbPFjEPG/Hxv7sNxo0ZjceU2pvOfEzh7E5KtACjQ6ws+6BUZBNelX H6uoH7FeZesK5wEjil3or6F3iLm6MHt7s9JyGof8lukCDlBfNciE88Apx6kH8B5W7U GZbcbumQIJ+LssorlNaR6eKPkmCpYZrRbds5NpZbBpvVNP32Ya9ifkK/hHYXV3vS6H E7eGizh+UL3vW9i3ZwloLnUthLZXNOYuXJ+8+1ZwYW3QPaTEgrSfxQKkrMl2UOl8qK 6O23e4/vU9u8Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id AF0B7688F6; Sun, 7 Dec 2025 13:17:56 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:15 -0700 Message-ID: <20251207201628.2882382-19-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: YZHXCVHZI4HOCQRRJLSJ6Y3A44UAQXRD X-Message-ID-Hash: YZHXCVHZI4HOCQRRJLSJ6Y3A44UAQXRD X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 18/22] expo: Correct rendering of textlines when open List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When a textline is open, we must render the edit string and show the cursor. The easiest way to do this is to draw the string again, then move the cursor back to the correct place. There is no need to change the font, since the rendering function handles this. Signed-off-by: Simon Glass --- boot/scene_textline.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/boot/scene_textline.c b/boot/scene_textline.c index 7e01959c40d..20e2d7f33c4 100644 --- a/boot/scene_textline.c +++ b/boot/scene_textline.c @@ -189,28 +189,21 @@ int scene_textline_render_deps(struct scene *scn, { const bool open = tline->obj.flags & SCENEOF_OPEN; struct udevice *cons = scn->expo->cons; - struct scene_obj_txt *txt; - int ret; - - scene_render_deps(scn, tline->label_id); - scene_render_deps(scn, tline->edit_id); + uint i; - /* show the vidconsole cursor if open */ + /* if open, render the edit text on top of the background */ if (open) { - /* get the position within the field */ - txt = scene_obj_find(scn, tline->edit_id, SCENEOBJT_NONE); - if (!txt) - return log_msg_ret("cur", -ENOENT); - - if (txt->gen.font_name || txt->gen.font_size) { - ret = vidconsole_select_font(cons, - txt->gen.font_name, - txt->gen.font_size); - } else { - ret = vidconsole_select_font(cons, NULL, 0); - } + int ret; ret = vidconsole_entry_restore(cons, &scn->entry_save); + if (ret) + return log_msg_ret("sav", ret); + scene_render_obj(scn, tline->edit_id); + + /* move cursor back to the correct position */ + for (i = scn->cls.num; i < scn->cls.eol_num; i++) + vidconsole_put_char(cons, '\b'); + ret = vidconsole_entry_save(cons, &scn->entry_save); if (ret) return log_msg_ret("sav", ret);