mirror of
https://github.com/JoeanAmier/XHS-Downloader.git
synced 2025-12-26 04:48:05 +08:00
更新 TUI 界面
This commit is contained in:
parent
3387225d13
commit
d99fef17ad
11
main.py
11
main.py
@ -2,6 +2,7 @@ from textual.app import App
|
||||
from textual.app import ComposeResult
|
||||
from textual.binding import Binding
|
||||
from textual.containers import HorizontalScroll
|
||||
from textual.containers import ScrollableContainer
|
||||
from textual.widgets import Button
|
||||
from textual.widgets import Footer
|
||||
from textual.widgets import Header
|
||||
@ -69,11 +70,11 @@ class XHSDownloader(App):
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Header()
|
||||
yield Label("请输入小红书图文/视频作品链接:")
|
||||
yield Input(placeholder="URL")
|
||||
yield HorizontalScroll(Button("下载无水印图片/视频", id="solo", variant="success"),
|
||||
Button("读取文件并开始批量下载作品", id="batch", variant="success"),
|
||||
Button("清空输入框", id="reset", variant="error"), )
|
||||
yield ScrollableContainer(Label("请输入小红书图文/视频作品链接:"),
|
||||
Input(placeholder="URL"),
|
||||
HorizontalScroll(Button("下载无水印图片/视频", id="solo"),
|
||||
Button("读取 xhs.txt 文件并批量下载作品", id="batch"),
|
||||
Button("清空输入框", id="reset"), ))
|
||||
yield Log(auto_scroll=True)
|
||||
yield Footer()
|
||||
|
||||
|
||||
@ -1,12 +1,36 @@
|
||||
Screen {
|
||||
layout: grid;
|
||||
grid-size: 1 2;
|
||||
grid-rows: 1fr;
|
||||
grid-columns: 1fr;
|
||||
grid-gutter: 1;
|
||||
}
|
||||
Button {
|
||||
width: 1fr;
|
||||
margin: 1 2;
|
||||
margin: 1 1;
|
||||
text-style: bold;
|
||||
}
|
||||
Button#solo {
|
||||
tint: green 35%;
|
||||
}
|
||||
Button#batch {
|
||||
tint: green 35%;
|
||||
}
|
||||
Button#reset {
|
||||
tint: red 35%;
|
||||
}
|
||||
Label {
|
||||
width: 100%;
|
||||
padding: 1;
|
||||
color: white;
|
||||
content-align-horizontal: center;
|
||||
content-align-vertical: middle;
|
||||
text-style: bold;
|
||||
}
|
||||
ScrollableContainer {
|
||||
row-span: 1;
|
||||
column-span: 1;
|
||||
}
|
||||
Log {
|
||||
row-span: 1;
|
||||
column-span: 1;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user