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.
|
/// The lower right corner of a window: drag to resize.
|
||||||
class WindowResizeCorner extends StatelessWidget {
|
class WindowResizeCorner extends StatelessWidget {
|
||||||
const WindowResizeCorner({
|
const WindowResizeCorner({
|
||||||
|
|||||||
@@ -300,6 +300,7 @@ class _WindowLayerState extends State<WindowLayer>
|
|||||||
onResizeEnd: _resizeEnded,
|
onResizeEnd: _resizeEnded,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Positioned.fromRect(rect: frame, child: const WindowOutline()),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
final center = widget.bounds.center(Offset.zero);
|
final center = widget.bounds.center(Offset.zero);
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# Floating window outline
|
||||||
|
|
||||||
|
- Added a one-logical-pixel `ColorScheme.outlineVariant` outline over the full
|
||||||
|
floating window perimeter, including the body painted by its navigator.
|
||||||
|
- The outline is non-interactive and keeps the existing title drag, body input,
|
||||||
|
resize, popup layering, and window state behavior unchanged.
|
||||||
|
- Focused checks: `window_host_test.dart`, `window_layering_test.dart`, and
|
||||||
|
`window_conveniences_test.dart` — 41 passed.
|
||||||
|
- `tool/analyze.sh` — clean.
|
||||||
|
- Browser captures were not run in this implementation stage; rendered review
|
||||||
|
remains for the UI review stage.
|
||||||
@@ -47,6 +47,36 @@ void main() {
|
|||||||
expect(tester.getRect(find.byType(ProbeContent)).top, greaterThan(80));
|
expect(tester.getRect(find.byType(ProbeContent)).top, greaterThan(80));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
testWidgets('the outline covers the full window and uses the theme palette', (
|
||||||
|
tester,
|
||||||
|
) async {
|
||||||
|
manager.open('probe', 'a');
|
||||||
|
await pumpProbe(tester, manager);
|
||||||
|
|
||||||
|
final outline = find.byType(WindowOutline);
|
||||||
|
expect(outline, findsOneWidget);
|
||||||
|
expect(tester.getSize(outline), const Size(360, 420));
|
||||||
|
final decoration =
|
||||||
|
tester
|
||||||
|
.widget<DecoratedBox>(
|
||||||
|
find.descendant(
|
||||||
|
of: outline,
|
||||||
|
matching: find.byType(DecoratedBox),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.decoration
|
||||||
|
as BoxDecoration;
|
||||||
|
expect(
|
||||||
|
decoration.border,
|
||||||
|
Border.all(
|
||||||
|
color: Theme.of(
|
||||||
|
tester.element(find.byType(WindowOutline)),
|
||||||
|
).colorScheme.outlineVariant,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
expect(decoration.borderRadius, BorderRadius.circular(windowCornerRadius));
|
||||||
|
});
|
||||||
|
|
||||||
testWidgets('the app behind takes input everywhere outside a window', (
|
testWidgets('the app behind takes input everywhere outside a window', (
|
||||||
tester,
|
tester,
|
||||||
) async {
|
) async {
|
||||||
|
|||||||
Reference in New Issue
Block a user