Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

feature: MouseCursor for expanding row #687

Naughtz402b29b3e3c9
diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/field_cell.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/field_cell.dart
index 8202a3537f..1d13870bbf 100755
--- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/field_cell.dart
+++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/field_cell.dart
@@ -115,12 +115,17 @@ class _DragToExpandLine extends StatelessWidget {
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onHorizontalDragUpdate: (value) {
- context.read<FieldCellBloc>().add(FieldCellEvent.startUpdateWidth(value.delta.dx));
+ context
+ .read<FieldCellBloc>()
+ .add(FieldCellEvent.startUpdateWidth(value.delta.dx));
},
onHorizontalDragEnd: (end) {
- context.read<FieldCellBloc>().add(const FieldCellEvent.endUpdateWidth());
+ context
+ .read<FieldCellBloc>()
+ .add(const FieldCellEvent.endUpdateWidth());
},
child: FlowyHover(
+ cursor: SystemMouseCursors.resizeLeftRight,
style: HoverStyle(
hoverColor: theme.main1,
borderRadius: BorderRadius.zero,
diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/hover.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/hover.dart
index 42ee43cabc..b9440bf1f1 100644
--- a/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/hover.dart
+++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/hover.dart
@@ -9,14 +9,16 @@ class FlowyHover extends StatefulWidget {
final HoverBuilder? builder;
final Widget? child;
final bool Function()? setSelected;
+ final MouseCursor? cursor;
- const FlowyHover({
- Key? key,
- this.builder,
- this.child,
- required this.style,
- this.setSelected,
- }) : super(key: key);
+ const FlowyHover(
+ {Key? key,
+ this.builder,
+ this.child,
+ required this.style,
+ this.setSelected,
+ this.cursor})
+ : super(key: key);
@override
State<FlowyHover> createState() => _FlowyHoverState();
@@ -28,7 +30,7 @@ class _FlowyHoverState extends State<FlowyHover> {
@override
Widget build(BuildContext context) {
return MouseRegion(
- cursor: SystemMouseCursors.click,
+ cursor: widget.cursor != null ? widget.cursor! : SystemMouseCursors.click,
opaque: false,
onEnter: (p) => setState(() => _onHover = true),
onExit: (p) => setState(() => _onHover = false),