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 {