From 81297b724f0274285806a321e616cfb969b9f8b3 Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Fri, 12 Sep 2025 17:14:24 +0800 Subject: [PATCH] =?UTF-8?q?refactor(installer):=20=E7=A7=BB=E9=99=A4appgui?= =?UTF-8?q?.topbar=E8=B0=83=E7=94=A8=E5=B9=B6=E6=81=A2=E5=A4=8D=E5=8E=9F?= =?UTF-8?q?=E5=A7=8B=E6=A0=87=E9=A2=98=E6=A0=8F=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 恢复使用原生term API实现标题栏显示,移除对appgui.topbar的依赖,保持界面风格一致性 --- installer.lua | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/installer.lua b/installer.lua index 5b5aa1a..107f4fc 100644 --- a/installer.lua +++ b/installer.lua @@ -70,27 +70,25 @@ local term = require("term") local colors = require("colors") local rc = require("rc") local appgui = require("appgui") --- -- 保存当前颜色设置 --- local old_fg = term.getTextColor() --- local old_bg = term.getBackgroundColor() +-- 保存当前颜色设置 +local old_fg = term.getTextColor() +local old_bg = term.getBackgroundColor() --- -- 设置名称栏颜色并显示 --- term.setTextColor(colors.white) --- term.setBackgroundColor(colors.cyan) --- term.at(1, 1).clearLine() --- term.at(1, 1).write("=== LeonOS Installer ===") - --- -- 恢复颜色设置 --- term.setTextColor(old_fg) --- term.setBackgroundColor(old_bg) --- term.at(1, 2) --- -- 只清除顶栏以下的区域 --- for y=2, term.getSize() do --- term.at(1, y).clearLine() --- end --- term.at(1, 2) -appgui.topbar("=== LeonOS Installer ===") +-- 设置名称栏颜色并显示 +term.setTextColor(colors.white) +term.setBackgroundColor(colors.cyan) +term.at(1, 1).clearLine() +term.at(1, 1).write("=== LeonOS Installer ===") +-- 恢复颜色设置 +term.setTextColor(old_fg) +term.setBackgroundColor(old_bg) +term.at(1, 2) +-- 只清除顶栏以下的区域 +for y=2, term.getSize() do + term.at(1, y).clearLine() +end +term.at(1, 2) tu.coloredPrint(colors.yellow, "LeonOS Installer (v"..INSTALLER_VERSION..")\n=======================") tu.coloredPrint("You are going to install LeonOS "..INSTALLER_VERSION.." to your computer.")