fix(interface): 修复 CSS_PATH 导致的样式覆写问题

This commit is contained in:
2026-04-22 06:55:58 +08:00
parent 7278cba258
commit 2c583d97d7
2 changed files with 10 additions and 8 deletions

View File

@@ -2,14 +2,10 @@
align-vertical: bottom; align-vertical: bottom;
} }
Switch { .setting-switch {
dock: right; dock: right;
} }
Label {
width: auto
}
Select { Select {
width: 55%; width: 55%;
dock: right; dock: right;
@@ -20,7 +16,7 @@ Input {
dock: right; dock: right;
} }
Horizontal { .setting-item {
width: 100%; width: 100%;
height: 4; height: 4;
padding: 0 0 1 0; padding: 0 0 1 0;

View File

@@ -46,7 +46,6 @@ class SettingScreen(Screen):
@on(events.ScreenResume) @on(events.ScreenResume)
def post_active(self, event): def post_active(self, event):
from heurams.interface import shim from heurams.interface import shim
shim.set_term_title(f"{self.app.TITLE} - {self.SUB_TITLE}") shim.set_term_title(f"{self.app.TITLE} - {self.SUB_TITLE}")
def compose(self) -> ComposeResult: def compose(self) -> ComposeResult:
@@ -113,6 +112,7 @@ class SettingScreen(Screen):
prompt=f'{parent.get(f"{i}", "")}', prompt=f'{parent.get(f"{i}", "")}',
id=domize(f"{parent_epath}.{i}"), id=domize(f"{parent_epath}.{i}"),
), ),
classes="setting-item"
) )
) )
elif isinstance(parent[f"_{i}_candidate"], list): elif isinstance(parent[f"_{i}_candidate"], list):
@@ -124,6 +124,7 @@ class SettingScreen(Screen):
prompt=f'{parent.get(f"{i}", "")}', prompt=f'{parent.get(f"{i}", "")}',
id=domize(f"{parent_epath}.{i}"), id=domize(f"{parent_epath}.{i}"),
), ),
classes="setting-item"
) )
) )
else: else:
@@ -137,6 +138,7 @@ class SettingScreen(Screen):
type="number", type="number",
id=domize(f"{parent_epath}.{i}"), id=domize(f"{parent_epath}.{i}"),
), ),
classes="setting-item"
) )
) )
elif isinstance(parent[i], str): elif isinstance(parent[i], str):
@@ -149,6 +151,7 @@ class SettingScreen(Screen):
type="text", type="text",
id=domize(f"{parent_epath}.{i}"), id=domize(f"{parent_epath}.{i}"),
), ),
classes="setting-item"
) )
) )
elif isinstance(parent[i], bool): elif isinstance(parent[i], bool):
@@ -156,8 +159,10 @@ class SettingScreen(Screen):
Horizontal( Horizontal(
Label(i + f'\n[d]{parent.get(f"_{i}_desc", "")}[/d]'), Label(i + f'\n[d]{parent.get(f"_{i}_desc", "")}[/d]'),
Switch( Switch(
value=parent[i], id=domize(f"{parent_epath}.{i}") value=parent[i], id=domize(f"{parent_epath}.{i}"),
classes="setting-switch",
), ),
classes="setting-item"
) )
) )
elif isinstance(parent[i], int): elif isinstance(parent[i], int):
@@ -170,6 +175,7 @@ class SettingScreen(Screen):
type="integer", type="integer",
id=domize(f"{parent_epath}.{i}"), id=domize(f"{parent_epath}.{i}"),
), ),
classes="setting-item"
) )
) )
elif isinstance(parent[i], list): elif isinstance(parent[i], list):