add window resize handles for frameless mode
Without OS decorations there are no resize handles. Added 6px edge and 12px corner invisible hit zones around the window perimeter via ClideResizeBorder. Each zone changes the cursor and calls gtk_window_begin_resize_drag via the clide/window method channel with a GdkWindowEdge direction. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,8 @@ import 'package:flutter/services.dart';
|
||||
|
||||
enum ChromeStyle { seam, prompt, inline }
|
||||
|
||||
enum ResizeEdge { topLeft, top, topRight, left, right, bottomLeft, bottom, bottomRight }
|
||||
|
||||
class WindowControls extends ChangeNotifier {
|
||||
static const _channel = MethodChannel('clide/window');
|
||||
|
||||
@@ -15,6 +17,14 @@ class WindowControls extends ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> startResize(ResizeEdge edge) async {
|
||||
try {
|
||||
await _channel.invokeMethod('startResize', edge.index);
|
||||
} on MissingPluginException {
|
||||
// no-op
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> startDrag() async {
|
||||
try {
|
||||
await _channel.invokeMethod('startDrag');
|
||||
|
||||
Reference in New Issue
Block a user