Add outline to floating windows

Paint a theme-derived one-pixel outline as a foreground overlay so the full floating window perimeter remains visible over navigator content without changing existing interaction geometry.
This commit is contained in:
2026-11-11 19:32:46 +00:00
parent 3da71c3053
commit a38f1bb3d1
4 changed files with 63 additions and 0 deletions
+21
View File
@@ -128,6 +128,27 @@ class WindowFrame extends StatelessWidget {
);
}
/// The foreground edge of a floating window. This is separate from
/// [WindowFrame] because the window body is painted by a later navigator
/// child and may otherwise cover the card's decoration.
class WindowOutline extends StatelessWidget {
const WindowOutline({super.key});
@override
Widget build(BuildContext context) {
final colors = Theme.of(context).colorScheme;
return IgnorePointer(
child: DecoratedBox(
decoration: BoxDecoration(
border: Border.all(color: colors.outlineVariant),
borderRadius: BorderRadius.circular(windowCornerRadius),
),
child: const SizedBox.expand(),
),
);
}
}
/// The lower right corner of a window: drag to resize.
class WindowResizeCorner extends StatelessWidget {
const WindowResizeCorner({
+1
View File
@@ -300,6 +300,7 @@ class _WindowLayerState extends State<WindowLayer>
onResizeEnd: _resizeEnded,
),
),
Positioned.fromRect(rect: frame, child: const WindowOutline()),
],
);
final center = widget.bounds.center(Offset.zero);