From 3022ada51aad3a63fd40badf6a0cbaf2b7c0df2e Mon Sep 17 00:00:00 2001 From: david-ajax Date: Mon, 29 Sep 2025 23:53:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=87=86=E5=A4=87=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- screens.py | 22 +++++++++------------- styles.css | 6 +++--- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/screens.py b/screens.py index 9f83a96..bf39832 100644 --- a/screens.py +++ b/screens.py @@ -153,29 +153,25 @@ class PreparationScreen(Screen): def compose(self) -> ComposeResult: yield Header(show_clock=True) - with Container(id="learning_screen_container"): - yield Label(f"记忆项目: [b]{self.nucleon_file.name}[/b]\n") - yield Label( - f"核子文件对象: ./nucleon/[b]{self.nucleon_file.name}[/b].toml" - ) - yield Label( - f"电子文件对象: ./electron/[b]{self.electron_file.name}[/b].toml" - ) - yield Label(f"核子数量:{len(self.nucleon_file)}") + with Container(id="vice_container"): + yield Label(f"准备就绪: [b]{self.nucleon_file.name}[/b]\n") + yield Label(f"内容源文件对象: ./nucleon/[b]{self.nucleon_file.name}[/b].toml") + yield Label(f"元数据文件对象: ./electron/[b]{self.electron_file.name}[/b].toml") + yield Label(f"\n单元数量:{len(self.nucleon_file)}\n") yield Button( "开始记忆", id="start_memorizing_button", variant="primary", classes="start-button", ) - yield Static(f"\n全文如下:\n") - yield Static(self._get_full_content().replace("/", ""), classes="full") + yield Static(f"\n单元预览:\n") + yield Markdown(self._get_full_content().replace("/", ""), classes="full") yield Footer() def _get_full_content(self): content = "" for i in self.nucleon_file.nucleons: - content += i["content"] + content += " - " + i["content"] + " \n" return content def action_go_back(self): @@ -234,7 +230,7 @@ class DashboardScreen(Screen): )) else: file_list_widget.append( - ListItem(Static("在 ./nucleon/ 中未找到任何核子文件. 请放置文件后重启应用.")) + ListItem(Static("在 ./nucleon/ 中未找到任何内容源数据文件.\n请放置文件后重启应用.")) ) file_list_widget.disabled = True diff --git a/styles.css b/styles.css index 3423466..38e1e6d 100644 --- a/styles.css +++ b/styles.css @@ -8,14 +8,14 @@ Screen { width: 95%; height: auto; border: thick $primary-lighten-2; - padding: 2; + padding: 1; } #vice_container { align: center middle; - width: 95%; + width: 100%; height: auto; - padding: 2; + padding: 1; } #sentence {