Floating windows: draw the resize grip under the window's tooltips
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -151,11 +151,16 @@ class WindowResizeCorner extends StatelessWidget {
|
||||
super.key,
|
||||
required this.onResize,
|
||||
required this.onResizeEnd,
|
||||
this.showGrip = true,
|
||||
});
|
||||
|
||||
final ValueChanged<Offset> 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 {
|
||||
|
||||
Reference in New Issue
Block a user