diff --git a/app/lib/shell/windows/window_frame.dart b/app/lib/shell/windows/window_frame.dart index d4596d43..74a5f9de 100644 --- a/app/lib/shell/windows/window_frame.dart +++ b/app/lib/shell/windows/window_frame.dart @@ -151,11 +151,16 @@ class WindowResizeCorner extends StatelessWidget { super.key, required this.onResize, required this.onResizeEnd, + this.showGrip = true, }); final ValueChanged onResize; final VoidCallback onResizeEnd; + /// Whether this target draws the grip itself. A window's page draws it + /// instead ([WindowResizeGrip]), under the tooltips its overlay shows. + final bool showGrip; + @override Widget build(BuildContext context) => Semantics( label: 'Resize window', @@ -167,19 +172,28 @@ class WindowResizeCorner extends StatelessWidget { dragStartBehavior: DragStartBehavior.down, onPanUpdate: (details) => onResize(details.delta), onPanEnd: (_) => onResizeEnd(), - child: Padding( - padding: const EdgeInsets.all(2), - child: Icon( - Icons.south_east, - size: 16, - color: Theme.of(context).colorScheme.onSurfaceVariant, - ), - ), + child: showGrip ? const WindowResizeGrip() : const SizedBox.expand(), ), ), ); } +/// The resize corner's arrow, drawn only (the drag target is +/// [WindowResizeCorner]). +class WindowResizeGrip extends StatelessWidget { + const WindowResizeGrip({super.key}); + + @override + Widget build(BuildContext context) => Padding( + padding: const EdgeInsets.all(2), + child: Icon( + Icons.south_east, + size: 16, + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), + ); +} + /// A transparent resize hit region. The visible lower-right affordance /// remains [WindowResizeCorner]; the other regions deliberately add no chrome. class WindowResizeHandle extends StatelessWidget { diff --git a/app/lib/shell/windows/window_layer.dart b/app/lib/shell/windows/window_layer.dart index 4d8c075c..a7bc97c7 100644 --- a/app/lib/shell/windows/window_layer.dart +++ b/app/lib/shell/windows/window_layer.dart @@ -396,6 +396,8 @@ class _WindowLayerState extends State corner, ), child: WindowResizeCorner( + // The window's page draws the grip, under its tooltips. + showGrip: false, onResize: (delta) => _resizeCorner(delta, const { WindowResizeEdge.right, WindowResizeEdge.bottom, diff --git a/app/lib/shell/windows/window_navigator.dart b/app/lib/shell/windows/window_navigator.dart index 8bc39f28..f395517d 100644 --- a/app/lib/shell/windows/window_navigator.dart +++ b/app/lib/shell/windows/window_navigator.dart @@ -2,7 +2,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'window_frame.dart' - show WindowOutline, windowCornerRadius, windowTitleBarHeight; + show + WindowOutline, + WindowResizeGrip, + windowCornerRadius, + windowTitleBarHeight; import 'window_scope.dart'; /// A floating window's own page stack. Pages pushed from the window's @@ -157,6 +161,13 @@ class WindowPageBox extends StatelessWidget { ), child: const WindowOutline(), ), + // The resize grip, likewise under the tooltips (the window layer + // keeps the drag target). + if (WindowScope.maybeOf(context)?.entry.maximized == false) + Positioned.fromRect( + rect: Rect.fromLTWH(body.right - 16, body.bottom - 16, 16, 16), + child: const IgnorePointer(child: WindowResizeGrip()), + ), ], ); }