Add the Windows menu, window cycling, edge snapping and size per kind
Phase 4 of docs/plans/floating-windows.md. A bar button lists the app's windows on every tab (show one, Show all, Minimise all, Close all). Alt+` and Alt+Shift+` bring the next or previous window to the front. Dropping a title at the left or right edge fills that half, at the top it maximises. A new window of a kind opens at the size that kind was last given.
This commit is contained in:
@@ -32,7 +32,9 @@ class WindowFrame extends StatelessWidget {
|
||||
final IconData icon;
|
||||
final List<WindowAction> actions;
|
||||
final bool maximized;
|
||||
final ValueChanged<Offset> onMove;
|
||||
|
||||
/// The drag's delta and the pointer's global position.
|
||||
final void Function(Offset delta, Offset globalPosition) onMove;
|
||||
final VoidCallback onMoveEnd;
|
||||
final VoidCallback onMinimize;
|
||||
final VoidCallback onToggleMaximized;
|
||||
@@ -100,7 +102,9 @@ class WindowFrame extends StatelessWidget {
|
||||
behavior: HitTestBehavior.opaque,
|
||||
// The window follows the pointer from where it went down.
|
||||
dragStartBehavior: DragStartBehavior.down,
|
||||
onPanUpdate: maximized ? null : (details) => onMove(details.delta),
|
||||
onPanUpdate: maximized
|
||||
? null
|
||||
: (details) => onMove(details.delta, details.globalPosition),
|
||||
onPanEnd: maximized ? null : (_) => onMoveEnd(),
|
||||
onDoubleTap: onToggleMaximized,
|
||||
child: Padding(
|
||||
|
||||
Reference in New Issue
Block a user