From 5eca39c6294cc61934de6539f1439a1f0521c348 Mon Sep 17 00:00:00 2001 From: mawei Date: Wed, 3 Jun 2026 11:40:00 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E9=A6=96=E9=A1=B5=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=85=8D=E8=B4=A3=E5=A3=B0=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- selfdrive/ui/layouts/home.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/selfdrive/ui/layouts/home.py b/selfdrive/ui/layouts/home.py index 05ba1a3b..18c6c235 100644 --- a/selfdrive/ui/layouts/home.py +++ b/selfdrive/ui/layouts/home.py @@ -183,12 +183,25 @@ class HomeLayout(Widget): def _render_home_content(self): # Display welcome text centered in content area font = gui_app.font(FontWeight.BOLD) + light_font = gui_app.font(FontWeight.NORMAL) text = "欢迎选用 MR.ONE" + subtitle = "这不是自动驾驶,请注意行车安全!" font_size = 120 + sub_font_size = 50 + text_size = measure_text_cached(font, text, font_size) - x = self.content_rect.x + (self.content_rect.width - text_size.x) / 2 - y = self.content_rect.y + (self.content_rect.height - text_size.y) / 2 - rl.draw_text_ex(font, text, rl.Vector2(int(x), int(y)), font_size, 0, rl.WHITE) + sub_size = measure_text_cached(light_font, subtitle, sub_font_size) + + cx = self.content_rect.x + self.content_rect.width / 2 + cy = self.content_rect.y + self.content_rect.height / 2 + + x = int(cx - text_size.x / 2) + y = int(cy - text_size.y) + rl.draw_text_ex(font, text, rl.Vector2(x, y), font_size, 0, rl.WHITE) + + sx = int(cx - sub_size.x / 2) + sy = y + text_size.y + 30 + rl.draw_text_ex(light_font, subtitle, rl.Vector2(sx, sy), sub_font_size, 0, rl.Color(200, 200, 200, 255)) def _render_update_view(self): self.update_alert.render(self.content_rect)