diff --git a/lib/pages/ai_config_page.dart b/lib/pages/ai_config_page.dart index 86f2f6c0..9758b9b5 100644 --- a/lib/pages/ai_config_page.dart +++ b/lib/pages/ai_config_page.dart @@ -402,15 +402,16 @@ class _AiConfigPageState extends State { l10n.aiTimeoutTitle, style: textTheme.titleMedium, ), - Text( - '${_aiTimeoutDraft}s', - style: textTheme.bodySmall?.copyWith( - color: cs.onSurfaceVariant, - ), - ), ], ), ), + Text( + '${_aiTimeoutDraft}s', + style: textTheme.bodyLarge?.copyWith( + color: cs.primary, + fontWeight: FontWeight.bold, + ), + ), ], ), SliderTheme( diff --git a/lib/pages/settings_page.dart b/lib/pages/settings_page.dart index 91d5970d..380bc11f 100644 --- a/lib/pages/settings_page.dart +++ b/lib/pages/settings_page.dart @@ -749,8 +749,11 @@ class _SettingsPageState extends State { ), Text( l10n.marqueeSpeedLabel(_marqueeSpeedDraft), - style: Theme.of(context).textTheme.bodySmall - ?.copyWith(color: cs.onSurfaceVariant), + style: Theme.of(context).textTheme.bodyLarge + ?.copyWith( + color: cs.primary, + fontWeight: FontWeight.bold, + ), ), if (_marqueeSpeedDraft != 100) SizedBox( @@ -822,12 +825,30 @@ class _SettingsPageState extends State { ), child: Row( children: [ + Expanded( + child: SliderTheme( + data: ModernSliderTheme.theme(context), + child: Slider( + value: _bigIslandMaxWidthDraft + .toDouble(), + min: 500, + max: 1000, + divisions: 54, + onChanged: _onBigIslandMaxWidthChanged, + onChangeEnd: _persistBigIslandMaxWidth, + ), + ), + ), + const SizedBox(width: 8), Text( l10n.bigIslandMaxWidthLabel( _bigIslandMaxWidthDraft, ), - style: Theme.of(context).textTheme.bodySmall - ?.copyWith(color: cs.onSurfaceVariant), + style: Theme.of(context).textTheme.bodyLarge + ?.copyWith( + color: cs.primary, + fontWeight: FontWeight.bold, + ), ), if (_bigIslandMaxWidthDraft != 600) SizedBox( @@ -849,20 +870,6 @@ class _SettingsPageState extends State { }, ), ), - Expanded( - child: SliderTheme( - data: ModernSliderTheme.theme(context), - child: Slider( - value: _bigIslandMaxWidthDraft - .toDouble(), - min: 500, - max: 1000, - divisions: 54, - onChanged: _onBigIslandMaxWidthChanged, - onChangeEnd: _persistBigIslandMaxWidth, - ), - ), - ), ], ), ), diff --git a/lib/pages/whitelist_page.dart b/lib/pages/whitelist_page.dart index 7608ee12..8fcfca9f 100644 --- a/lib/pages/whitelist_page.dart +++ b/lib/pages/whitelist_page.dart @@ -344,24 +344,61 @@ class WhitelistPageState extends State { ], ), - // 说明 + 搜索栏 + // 说明文本(随列表滚动,不吸顶) SliverToBoxAdapter( - child: Container( + child: Padding( padding: const EdgeInsets.fromLTRB(16, 0, 16, 12), - child: AppListSearchHeader( - countText: _ctrl.showSystemApps + child: Text( + _ctrl.showSystemApps ? l10n.enabledAppsCountWithSystem(enabledCount) : l10n.enabledAppsCount(enabledCount), - showCountText: true, - searchController: _searchCtrl, - searchFocusNode: _searchFocus, - hintText: l10n.searchApps, - onChanged: _ctrl.setSearch, - onClear: _clearSearch, + style: Theme.of( + context, + ).textTheme.bodyMedium?.copyWith(color: cs.onSurfaceVariant), ), ), ), + // 搜索栏(仅搜索框吸顶) + SliverPersistentHeader( + pinned: true, + delegate: FixedSliverHeaderDelegate( + height: 60, + minHeight: 60, + builder: (context, overlapsContent, collapseProgress) { + final appBarTheme = Theme.of(context).appBarTheme; + final elevation = appBarTheme.scrolledUnderElevation ?? 3.0; + final pinnedBg = overlapsContent + ? ElevationOverlay.applySurfaceTint( + cs.surface, + cs.surfaceTint, + elevation, + ) + : cs.surface; + return Material( + color: pinnedBg, + surfaceTintColor: Theme.of(context).colorScheme.surfaceTint, + elevation: 0, + child: Container( + padding: const EdgeInsets.fromLTRB(16, 0, 16, 12), + child: AppListSearchHeader( + countText: '', + showCountText: false, + searchController: _searchCtrl, + searchFocusNode: _searchFocus, + hintText: l10n.searchApps, + searchBarBackgroundColor: overlapsContent + ? cs.surface + : cs.surfaceContainerHighest, + onChanged: _ctrl.setSearch, + onClear: _clearSearch, + ), + ), + ); + }, + ), + ), + // 内容区 if (_ctrl.loading) const SliverFillRemaining( diff --git a/lib/widgets/app_list_widgets.dart b/lib/widgets/app_list_widgets.dart index 61001cc8..c0456a96 100644 --- a/lib/widgets/app_list_widgets.dart +++ b/lib/widgets/app_list_widgets.dart @@ -7,6 +7,7 @@ class AppListSearchHeader extends StatelessWidget { super.key, required this.countText, this.showCountText = true, + this.searchBarBackgroundColor, required this.searchController, required this.searchFocusNode, required this.hintText, @@ -16,6 +17,7 @@ class AppListSearchHeader extends StatelessWidget { final String countText; final bool showCountText; + final Color? searchBarBackgroundColor; final TextEditingController searchController; final FocusNode searchFocusNode; final String hintText; @@ -53,7 +55,9 @@ class AppListSearchHeader extends StatelessWidget { EdgeInsets.symmetric(horizontal: 16), ), elevation: const WidgetStatePropertyAll(0), - backgroundColor: WidgetStatePropertyAll(cs.surfaceContainerHighest), + backgroundColor: WidgetStatePropertyAll( + searchBarBackgroundColor ?? cs.surfaceContainerHighest, + ), constraints: const BoxConstraints(minHeight: 48, maxHeight: 48), ), ],