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