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:
@@ -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({
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user