Fix search sources in search results page.

This commit is contained in:
2025-04-05 19:31:41 +08:00
parent f87afbe397
commit 554b9f2a77
2 changed files with 10 additions and 3 deletions

View File

@@ -384,7 +384,8 @@
"Pages": "页数",
"Long press zoom position": "长按缩放位置",
"Press position": "按压位置",
"Screen center": "屏幕中心"
"Screen center": "屏幕中心",
"Suggestions": "建议"
},
"zh_TW": {
"Home": "首頁",
@@ -771,6 +772,7 @@
"Pages": "頁數",
"Long press zoom position": "長按縮放位置",
"Press position": "按壓位置",
"Screen center": "螢幕中心"
"Screen center": "螢幕中心",
"Suggestions": "建議"
}
}

View File

@@ -441,6 +441,11 @@ class _SearchSettingsDialogState extends State<_SearchSettingsDialog> {
@override
Widget build(BuildContext context) {
var sources = ComicSource.all();
var enabled = appdata.settings['searchSources'] as List;
sources.removeWhere((e) {
return !enabled.contains(e.key);
});
return ContentDialog(
title: "Settings".tl,
content: Column(
@@ -452,7 +457,7 @@ class _SearchSettingsDialogState extends State<_SearchSettingsDialog> {
Wrap(
spacing: 8,
runSpacing: 8,
children: ComicSource.all().map((e) {
children: sources.map((e) {
return OptionChip(
text: e.name.tl,
isSelected: searchTarget == e.key,