更新准备界面
This commit is contained in:
22
screens.py
22
screens.py
@@ -153,29 +153,25 @@ class PreparationScreen(Screen):
|
|||||||
|
|
||||||
def compose(self) -> ComposeResult:
|
def compose(self) -> ComposeResult:
|
||||||
yield Header(show_clock=True)
|
yield Header(show_clock=True)
|
||||||
with Container(id="learning_screen_container"):
|
with Container(id="vice_container"):
|
||||||
yield Label(f"记忆项目: [b]{self.nucleon_file.name}[/b]\n")
|
yield Label(f"准备就绪: [b]{self.nucleon_file.name}[/b]\n")
|
||||||
yield Label(
|
yield Label(f"内容源文件对象: ./nucleon/[b]{self.nucleon_file.name}[/b].toml")
|
||||||
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 Label(
|
|
||||||
f"电子文件对象: ./electron/[b]{self.electron_file.name}[/b].toml"
|
|
||||||
)
|
|
||||||
yield Label(f"核子数量:{len(self.nucleon_file)}")
|
|
||||||
yield Button(
|
yield Button(
|
||||||
"开始记忆",
|
"开始记忆",
|
||||||
id="start_memorizing_button",
|
id="start_memorizing_button",
|
||||||
variant="primary",
|
variant="primary",
|
||||||
classes="start-button",
|
classes="start-button",
|
||||||
)
|
)
|
||||||
yield Static(f"\n全文如下:\n")
|
yield Static(f"\n单元预览:\n")
|
||||||
yield Static(self._get_full_content().replace("/", ""), classes="full")
|
yield Markdown(self._get_full_content().replace("/", ""), classes="full")
|
||||||
yield Footer()
|
yield Footer()
|
||||||
|
|
||||||
def _get_full_content(self):
|
def _get_full_content(self):
|
||||||
content = ""
|
content = ""
|
||||||
for i in self.nucleon_file.nucleons:
|
for i in self.nucleon_file.nucleons:
|
||||||
content += i["content"]
|
content += " - " + i["content"] + " \n"
|
||||||
return content
|
return content
|
||||||
|
|
||||||
def action_go_back(self):
|
def action_go_back(self):
|
||||||
@@ -234,7 +230,7 @@ class DashboardScreen(Screen):
|
|||||||
))
|
))
|
||||||
else:
|
else:
|
||||||
file_list_widget.append(
|
file_list_widget.append(
|
||||||
ListItem(Static("在 ./nucleon/ 中未找到任何核子文件. 请放置文件后重启应用."))
|
ListItem(Static("在 ./nucleon/ 中未找到任何内容源数据文件.\n请放置文件后重启应用."))
|
||||||
)
|
)
|
||||||
file_list_widget.disabled = True
|
file_list_widget.disabled = True
|
||||||
|
|
||||||
|
@@ -8,14 +8,14 @@ Screen {
|
|||||||
width: 95%;
|
width: 95%;
|
||||||
height: auto;
|
height: auto;
|
||||||
border: thick $primary-lighten-2;
|
border: thick $primary-lighten-2;
|
||||||
padding: 2;
|
padding: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#vice_container {
|
#vice_container {
|
||||||
align: center middle;
|
align: center middle;
|
||||||
width: 95%;
|
width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
padding: 2;
|
padding: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#sentence {
|
#sentence {
|
||||||
|
Reference in New Issue
Block a user