Sheet peek/expand, theme-aware media stage, and edge-to-edge viewer bars
Long-content bottom sheets (Details' Versions/Activity tabs with many rows) opened locked to nearly full screen height with no room left to adjust. showNooSheet now measures its content once against the available height: anything that fits comfortably still sizes to content as before, but content tall enough to need scrolling opens at a native-style draggable peek instead, which the user can drag up to reveal more of (and drag back down to dismiss). The media viewer's stage was pinned to black regardless of theme, which read as jarringly out of place in light mode - it now follows the app's own `bg`. The floating top/bottom bars stay a fixed dark panel either way (they need to read over arbitrary photo/video brightness, not over the stage), but both had their SafeArea nested the wrong way around: it wrapped the whole panel instead of just its content, so the panel's background stopped short of the actual screen edge - most visibly the bottom bar ending above the gesture area instead of extending behind it. The background now wraps the SafeArea instead.
This commit is contained in:
@@ -376,14 +376,13 @@ class _FileViewerScreenState extends State<FileViewerScreen> {
|
||||
final session = context.read<SessionController>();
|
||||
final ops = context.read<ItemOperations>();
|
||||
final colors = context.nooColors;
|
||||
// The stage behind the media itself is pure black rather than `bg` -
|
||||
// the near-universal "letterbox" convention of photo/video viewers
|
||||
// (matting an image/video in the app's warm neutral background reads
|
||||
// as unfinished, and black also hides any letterboxing from
|
||||
// `BoxFit.contain`/`AspectRatio` at the screen edges). PDFs/text/
|
||||
// unsupported-file previews aren't "viewed" the same way - they're
|
||||
// read, so they stay on the normal `bg` like any other screen.
|
||||
final stageColor = _isSwipeable ? Colors.black : colors.bg;
|
||||
// The stage follows the app's own theme (`bg`) rather than being pinned
|
||||
// to black - a black stage in light mode read as jarringly out of place
|
||||
// next to the rest of the light-themed app. The floating top/action
|
||||
// bars stay a fixed dark frosted panel regardless (see
|
||||
// FrostedGlassContainer's doc comment) since they need to read over
|
||||
// arbitrary photo/video brightness, not over this background.
|
||||
final stageColor = colors.bg;
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: stageColor,
|
||||
@@ -437,9 +436,13 @@ class _FileViewerScreenState extends State<FileViewerScreen> {
|
||||
offset: _controlsVisible ? Offset.zero : const Offset(0, -1.4),
|
||||
child: IgnorePointer(
|
||||
ignoring: !_controlsVisible,
|
||||
child: SafeArea(
|
||||
bottom: false,
|
||||
child: FrostedGlassContainer(
|
||||
// The blurred/tinted background lives outside the SafeArea
|
||||
// (not inside it) so it extends up behind the status bar
|
||||
// instead of stopping short beneath it - see the matching
|
||||
// fix/comment on MediaActionBar's own SafeArea.
|
||||
child: FrostedGlassContainer(
|
||||
child: SafeArea(
|
||||
bottom: false,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 6,
|
||||
@@ -447,10 +450,9 @@ class _FileViewerScreenState extends State<FileViewerScreen> {
|
||||
),
|
||||
child: IconTheme.merge(
|
||||
// Fixed white, not `colors.fg1`: this bar always
|
||||
// sits on the dark translucent panel over a black
|
||||
// media stage (see `FrostedGlassContainer`'s doc
|
||||
// comment), regardless of the app's light/dark
|
||||
// theme.
|
||||
// sits on the dark translucent panel over the media
|
||||
// stage (see `FrostedGlassContainer`'s doc comment),
|
||||
// regardless of the app's light/dark theme.
|
||||
data: const IconThemeData(
|
||||
color: Colors.white,
|
||||
size: 24,
|
||||
|
||||
Reference in New Issue
Block a user