Show shared resize grips on list pane dividers
This commit is contained in:
@@ -1,51 +0,0 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../ui/adaptive/host.dart';
|
||||
|
||||
/// The same visible resize affordance for a mobile peek or a split pane.
|
||||
class ChatDividerGrip extends StatelessWidget {
|
||||
const ChatDividerGrip({
|
||||
super.key,
|
||||
this.axis = Axis.horizontal,
|
||||
this.emphasized = false,
|
||||
this.compact = false,
|
||||
});
|
||||
|
||||
final Axis axis;
|
||||
final bool emphasized;
|
||||
final bool compact;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cupertino = usesCupertinoHost(context);
|
||||
return RotatedBox(
|
||||
quarterTurns: axis == Axis.vertical ? 1 : 0,
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: cupertino
|
||||
? CupertinoColors.secondarySystemBackground.resolveFrom(context)
|
||||
: Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: emphasized
|
||||
? Border.all(
|
||||
color: cupertino
|
||||
? CupertinoTheme.of(context).primaryColor
|
||||
: Theme.of(context).colorScheme.primary,
|
||||
)
|
||||
: null,
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: compact ? 6 : 8),
|
||||
child: Icon(
|
||||
cupertino ? CupertinoIcons.minus : Icons.drag_handle,
|
||||
size: compact ? 12 : 18,
|
||||
color: cupertino
|
||||
? CupertinoColors.secondaryLabel.resolveFrom(context)
|
||||
: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'dart:math' as math;
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'chat_divider_grip.dart';
|
||||
import '../../../ui/adaptive/resize_grip.dart';
|
||||
|
||||
/// A transparent touch target centred on the active chat's coloured bottom
|
||||
/// border. Height is bounded by the original 20% peek and a nonzero minimum.
|
||||
@@ -71,7 +71,7 @@ class _ChatMobilePeekDividerState extends State<ChatMobilePeekDivider> {
|
||||
onVerticalDragCancel: () => _dragHeight = null,
|
||||
child: Tooltip(
|
||||
message: 'Drag to resize inactive chat',
|
||||
child: Center(child: ChatDividerGrip(emphasized: _focused)),
|
||||
child: Center(child: AdaptiveResizeGrip(emphasized: _focused)),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:flutter/services.dart';
|
||||
|
||||
import '../../../ui/adaptive/host.dart';
|
||||
import 'chat_workspace_controller.dart';
|
||||
import 'chat_divider_grip.dart';
|
||||
import '../../../ui/adaptive/resize_grip.dart';
|
||||
import 'chat_workspace_geometry.dart';
|
||||
|
||||
/// A standard separator with a mouse/touch grab area and keyboard resizing.
|
||||
@@ -112,7 +112,7 @@ class _ChatWorkspaceDividerState extends State<ChatWorkspaceDivider> {
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: ChatDividerGrip(
|
||||
child: AdaptiveResizeGrip(
|
||||
axis: verticalLine ? Axis.vertical : Axis.horizontal,
|
||||
compact: true,
|
||||
emphasized: _hovered || _focused || _drag != null,
|
||||
|
||||
Reference in New Issue
Block a user