generated from dellevin/template
优化搜索界面
This commit is contained in:
@@ -168,7 +168,7 @@ class _DesktopHomePageState extends State<DesktopHomePage> {
|
||||
if (_showNotes) {
|
||||
final words = fn.fold<int>(0, (sum, n) => sum + n.content.length);
|
||||
final ws = words >= 10000 ? '${(words / 10000).toStringAsFixed(1)}万' : '$words';
|
||||
items.add(_ModuleData(Icons.note_outlined, '笔记', fn.length, '$ws字', _noteColor, 2));
|
||||
items.add(_ModuleData(Icons.sticky_note_2_outlined, '笔记', fn.length, '$ws字', _noteColor, 2));
|
||||
}
|
||||
if (_showGames) {
|
||||
final completed = fg.where((g) => g.status == 'completed').length;
|
||||
|
||||
@@ -307,8 +307,8 @@ class _DesktopIconRail extends StatelessWidget {
|
||||
static const _categoryMeta = [
|
||||
(Icons.movie_outlined, Icons.movie, '影视', 0, Color(0xFF2563EB)),
|
||||
(Icons.menu_book_outlined, Icons.menu_book, '阅读', 1, Color(0xFF16A34A)),
|
||||
(Icons.note_outlined, Icons.note, '笔记', 2, Color(0xFF9333EA)),
|
||||
(Icons.sports_esports_outlined, Icons.sports_esports, '游戏', 3, Color(0xFFEA580C)),
|
||||
(Icons.sticky_note_2_outlined, Icons.sticky_note_2, '笔记', 2, Color(0xFF9333EA)),
|
||||
];
|
||||
|
||||
@override
|
||||
@@ -880,7 +880,7 @@ class _StrollDialogState extends State<_StrollDialog> {
|
||||
for (final n in provider.notes.where((n) => !n.isDeleted)) {
|
||||
notePool.add(_StrollItem(type: 'note', data: n, id: 'n_${n.id}', title: n.title.isNotEmpty ? n.title : '随手记',
|
||||
subtitle: n.tags.take(3).join(' · '), detail: n.content, imagePath: n.images.isNotEmpty ? n.images.first : null,
|
||||
icon: Icons.note_outlined, label: '笔记', createdAt: n.createdAt,
|
||||
icon: Icons.sticky_note_2_outlined, label: '笔记', createdAt: n.createdAt,
|
||||
tags: n.tags.take(3).toList(), color: const Color(0xFF66BB6A)));
|
||||
}
|
||||
}
|
||||
@@ -1758,7 +1758,7 @@ class _TagManagementDialogState extends State<_TagManagementDialog> {
|
||||
|
||||
static const _tabTypes = ['movie_genre', 'book_genre', 'note_tag', 'game_genre'];
|
||||
static const _typeLabels = ['影视类型', '书籍类型', '笔记标签', '游戏类型'];
|
||||
static const _typeIcons = [Icons.movie_outlined, Icons.menu_book_outlined, Icons.note_outlined, Icons.sports_esports_outlined];
|
||||
static const _typeIcons = [Icons.movie_outlined, Icons.menu_book_outlined, Icons.sticky_note_2_outlined, Icons.sports_esports_outlined];
|
||||
|
||||
final Map<String, List<Map<String, dynamic>>> _tagCache = {};
|
||||
Map<String, int> _usageCounts = {};
|
||||
@@ -3918,7 +3918,7 @@ class _DesktopListPanelState extends State<_DesktopListPanel> {
|
||||
if (a.isPinned != b.isPinned) return a.isPinned ? -1 : 1;
|
||||
return b.createdAt.compareTo(a.createdAt);
|
||||
});
|
||||
if (items.isEmpty) return _buildEmpty('暂无笔记记录', Icons.note_outlined);
|
||||
if (items.isEmpty) return _buildEmpty('暂无笔记记录', Icons.sticky_note_2_outlined);
|
||||
return ListView.builder(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4),
|
||||
itemCount: items.length,
|
||||
@@ -4096,7 +4096,7 @@ class _DesktopListPanelState extends State<_DesktopListPanel> {
|
||||
subtitle: n.content.length > 40 ? '${n.content.substring(0, 40)}...' : null,
|
||||
imagePath: null,
|
||||
accentColor: const Color(0xFF9333EA),
|
||||
icon: Icons.note_outlined,
|
||||
icon: Icons.sticky_note_2_outlined,
|
||||
selected: provider.selectedNote?.id == n.id,
|
||||
onTap: () {
|
||||
provider.setMainTabIndex(2);
|
||||
|
||||
@@ -8,8 +8,7 @@ import '../movies/movie_tab_page.dart';
|
||||
import '../book/book_tab_page.dart';
|
||||
import '../note/note_tab_page.dart';
|
||||
import '../game/game_tab_page.dart';
|
||||
import '../online_search/search_page.dart';
|
||||
import '../online_search/online_search_page.dart';
|
||||
import '../online_search/search_hub_page.dart';
|
||||
import '../sync/webdav_sync_page.dart';
|
||||
|
||||
/// 主内容页 - 观影/阅读/笔记标签页(PageView 滑动切换)
|
||||
@@ -71,8 +70,8 @@ class _MainContentPageState extends State<MainContentPage> {
|
||||
final tabs = <_TabItem>[];
|
||||
if (_showMovieTab) tabs.add(_TabItem('影视', 0));
|
||||
if (_showBookTab) tabs.add(_TabItem('阅读', 1));
|
||||
if (_showNoteTab) tabs.add(_TabItem('笔记', 2));
|
||||
if (_showGameTab) tabs.add(_TabItem('游戏', 3));
|
||||
if (_showNoteTab) tabs.add(_TabItem('笔记', 2));
|
||||
return tabs;
|
||||
}
|
||||
|
||||
@@ -119,30 +118,7 @@ class _MainContentPageState extends State<MainContentPage> {
|
||||
_buildCloudSyncButton(context),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.search),
|
||||
onPressed: () => Navigator.push(context, MaterialPageRoute(builder: (_) => const SearchPage())),
|
||||
),
|
||||
if (UserPrefs().enhancedSearchEnabled)
|
||||
IconButton(
|
||||
icon: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
const Icon(Icons.search, size: 22),
|
||||
Positioned(
|
||||
right: -3,
|
||||
top: -3,
|
||||
child: Container(
|
||||
width: 12,
|
||||
height: 12,
|
||||
decoration: BoxDecoration(
|
||||
color: colors.surface,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Icon(Icons.add, size: 10, color: colors.onSurface),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
onPressed: () => Navigator.push(context, MaterialPageRoute(builder: (_) => const OnlineSearchPage())),
|
||||
onPressed: () => Navigator.push(context, MaterialPageRoute(builder: (_) => const SearchHubPage())),
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -431,8 +407,8 @@ class _MainContentPageState extends State<MainContentPage> {
|
||||
children: [
|
||||
if (_showMovieTab) const MovieTabPage(),
|
||||
if (_showBookTab) const BookTabPage(),
|
||||
if (_showNoteTab) const NoteTabPage(),
|
||||
if (_showGameTab) const GameTabPage(),
|
||||
if (_showNoteTab) const NoteTabPage(),
|
||||
],
|
||||
);
|
||||
},
|
||||
@@ -443,7 +419,7 @@ class _MainContentPageState extends State<MainContentPage> {
|
||||
switch (label) {
|
||||
case '影视': return Icons.movie_outlined;
|
||||
case '阅读': return Icons.menu_book_outlined;
|
||||
case '笔记': return Icons.note_outlined;
|
||||
case '笔记': return Icons.sticky_note_2_outlined;
|
||||
case '游戏': return Icons.sports_esports_outlined;
|
||||
default: return Icons.circle;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user