Enable floating chat window resizing everywhere
Install directional hit regions in the shared window layer so floating chats can be moved and resized on every destination. Keep geometry updates in the shared manager and cover directional resizing with window host regressions.
This commit is contained in:
@@ -179,3 +179,32 @@ class WindowResizeCorner extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// A transparent resize hit region. The visible lower-right affordance
|
||||
/// remains [WindowResizeCorner]; the other regions deliberately add no chrome.
|
||||
class WindowResizeHandle extends StatelessWidget {
|
||||
const WindowResizeHandle({
|
||||
super.key,
|
||||
required this.cursor,
|
||||
required this.onResize,
|
||||
required this.onResizeEnd,
|
||||
this.child,
|
||||
});
|
||||
|
||||
final MouseCursor cursor;
|
||||
final ValueChanged<Offset> onResize;
|
||||
final VoidCallback onResizeEnd;
|
||||
final Widget? child;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => MouseRegion(
|
||||
cursor: cursor,
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
dragStartBehavior: DragStartBehavior.down,
|
||||
onPanUpdate: (details) => onResize(details.delta),
|
||||
onPanEnd: (_) => onResizeEnd(),
|
||||
child: child ?? const SizedBox.expand(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user