From 554b9f2a77658eaf7fc29e0421e8a06e7d8687d1 Mon Sep 17 00:00:00 2001 From: nyne Date: Sat, 5 Apr 2025 19:31:41 +0800 Subject: [PATCH] Fix search sources in search results page. --- assets/translation.json | 6 ++++-- lib/pages/search_result_page.dart | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/assets/translation.json b/assets/translation.json index 4b42aa2..51e8819 100644 --- a/assets/translation.json +++ b/assets/translation.json @@ -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": "建議" } } diff --git a/lib/pages/search_result_page.dart b/lib/pages/search_result_page.dart index 94f700d..c0abf46 100644 --- a/lib/pages/search_result_page.dart +++ b/lib/pages/search_result_page.dart @@ -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,