From 8bdf2b53d3932ddf6bbfb3cd2e4b0e2b2c510437 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Wed, 18 Mar 2026 09:46:12 +0100 Subject: [PATCH] fix: reduce bottom sheet spacing --- lib/widgets/bottom_sheet_header.dart | 4 ++-- lib/widgets/focusable_list_tile.dart | 21 ++++++++++++++++--- .../video_controls/sheets/track_sheet.dart | 2 +- .../sheets/video_settings_sheet.dart | 12 +++++------ 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/lib/widgets/bottom_sheet_header.dart b/lib/widgets/bottom_sheet_header.dart index 534a48ca..1da9aba1 100644 --- a/lib/widgets/bottom_sheet_header.dart +++ b/lib/widgets/bottom_sheet_header.dart @@ -81,10 +81,10 @@ class BottomSheetHeader extends StatelessWidget { } // Determine the title style - final effectiveTitleStyle = titleStyle ?? TextStyle(fontSize: 20, fontWeight: FontWeight.bold, color: titleColor); + final effectiveTitleStyle = titleStyle ?? TextStyle(fontSize: 18, fontWeight: FontWeight.bold, color: titleColor); return Container( - padding: const EdgeInsets.all(16), + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), decoration: showBorder ? BoxDecoration( border: Border(bottom: BorderSide(color: Theme.of(context).dividerColor)), diff --git a/lib/widgets/focusable_list_tile.dart b/lib/widgets/focusable_list_tile.dart index b2470125..057639a6 100644 --- a/lib/widgets/focusable_list_tile.dart +++ b/lib/widgets/focusable_list_tile.dart @@ -55,6 +55,9 @@ class FocusableListTile extends StatefulWidget { /// An optional color for the icon of the list tile. final Color? iconColor; + /// Visual density for the list tile. + final VisualDensity? visualDensity; + const FocusableListTile({ super.key, this.title, @@ -63,7 +66,7 @@ class FocusableListTile extends StatefulWidget { this.trailing, this.onTap, this.onLongPress, - this.dense = false, + this.dense = true, this.enabled = true, this.selected = false, this.focusNode, @@ -73,6 +76,7 @@ class FocusableListTile extends StatefulWidget { this.hoverColor, this.textColor, this.iconColor, + this.visualDensity = const VisualDensity(vertical: -3), }); @override @@ -150,6 +154,7 @@ class _FocusableListTileState extends State { enabled: widget.enabled, selected: widget.selected, contentPadding: widget.contentPadding, + visualDensity: widget.visualDensity, focusNode: widget.suppressInitialSelect ? null : _effectiveFocusNode, autofocus: widget.suppressInitialSelect ? false : widget.autofocus, hoverColor: widget.hoverColor, @@ -209,16 +214,20 @@ class FocusableRadioListTile extends StatefulWidget { /// Whether the radio tile is interactive. final bool? enabled; + /// Visual density for the list tile. + final VisualDensity? visualDensity; + const FocusableRadioListTile({ super.key, this.title, this.subtitle, this.secondary, required this.value, - this.dense = false, + this.dense = true, this.focusNode, this.autofocus = false, this.enabled, + this.visualDensity = const VisualDensity(vertical: -3), }); @override @@ -281,6 +290,7 @@ class _FocusableRadioListTileState extends State> { value: widget.value, // groupValue and onChanged provided by RadioGroup ancestor dense: widget.dense, + visualDensity: widget.visualDensity, focusNode: _effectiveFocusNode, autofocus: widget.autofocus, enabled: widget.enabled, @@ -316,6 +326,9 @@ class FocusableSwitchListTile extends StatefulWidget { /// Whether this tile should autofocus when first built. final bool autofocus; + /// Visual density for the list tile. + final VisualDensity? visualDensity; + const FocusableSwitchListTile({ super.key, this.title, @@ -323,9 +336,10 @@ class FocusableSwitchListTile extends StatefulWidget { this.secondary, required this.value, required this.onChanged, - this.dense = false, + this.dense = true, this.focusNode, this.autofocus = false, + this.visualDensity = const VisualDensity(vertical: -3), }); @override @@ -388,6 +402,7 @@ class _FocusableSwitchListTileState extends State { value: widget.value, onChanged: widget.onChanged, dense: widget.dense, + visualDensity: widget.visualDensity, focusNode: _effectiveFocusNode, autofocus: widget.autofocus, ); diff --git a/lib/widgets/video_controls/sheets/track_sheet.dart b/lib/widgets/video_controls/sheets/track_sheet.dart index 6a6f4382..2e83b19b 100644 --- a/lib/widgets/video_controls/sheets/track_sheet.dart +++ b/lib/widgets/video_controls/sheets/track_sheet.dart @@ -319,7 +319,7 @@ class _ColumnHeader extends StatelessWidget { @override Widget build(BuildContext context) { return Padding( - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10), + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6), child: Align( alignment: Alignment.centerLeft, child: Text( diff --git a/lib/widgets/video_controls/sheets/video_settings_sheet.dart b/lib/widgets/video_controls/sheets/video_settings_sheet.dart index 4c37271f..c2220d8d 100644 --- a/lib/widgets/video_controls/sheets/video_settings_sheet.dart +++ b/lib/widgets/video_controls/sheets/video_settings_sheet.dart @@ -383,7 +383,7 @@ class _VideoSettingsSheetState extends State { // HDR Toggle (iOS, macOS, and Windows) if (Platform.isIOS || Platform.isMacOS || Platform.isWindows) - ListTile( + FocusableListTile( leading: AppIcon(Symbols.hdr_strong_rounded, fill: 1, color: _enableHDR ? Colors.amber : tokens(context).textMuted), title: Text(t.videoSettings.hdr), trailing: Switch(value: _enableHDR, onChanged: (_) => _toggleHDR(), activeThumbColor: Colors.amber), @@ -391,7 +391,7 @@ class _VideoSettingsSheetState extends State { ), // Auto-Play Next Episode Toggle - ListTile( + FocusableListTile( leading: AppIcon( Symbols.skip_next_rounded, fill: 1, @@ -429,7 +429,7 @@ class _VideoSettingsSheetState extends State { // Audio Passthrough (Desktop only) if (isDesktop) - ListTile( + FocusableListTile( leading: AppIcon( Symbols.surround_sound_rounded, fill: 1, @@ -446,7 +446,7 @@ class _VideoSettingsSheetState extends State { // Audio Normalization (MPV only) if (widget.player.playerType == 'mpv') - ListTile( + FocusableListTile( leading: AppIcon( Symbols.graphic_eq_rounded, fill: 1, @@ -473,7 +473,7 @@ class _VideoSettingsSheetState extends State { // Ambient Lighting (MPV only) if (widget.onToggleAmbientLighting != null) - ListTile( + FocusableListTile( leading: AppIcon( Symbols.blur_on, fill: 1, @@ -495,7 +495,7 @@ class _VideoSettingsSheetState extends State { ), // Performance Overlay Toggle - ListTile( + FocusableListTile( leading: AppIcon( Symbols.analytics_rounded, fill: 1,