mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
FR: MouseCursor for expanding row #687
This commit is contained in:
parent
25226bf26b
commit
79d19eba87
frontend/app_flowy
lib/workspace/presentation/plugins/grid/src/widgets/header
packages/flowy_infra_ui/lib/style_widget
@ -115,12 +115,17 @@ class _DragToExpandLine extends StatelessWidget {
|
|||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
onHorizontalDragUpdate: (value) {
|
onHorizontalDragUpdate: (value) {
|
||||||
context.read<FieldCellBloc>().add(FieldCellEvent.startUpdateWidth(value.delta.dx));
|
context
|
||||||
|
.read<FieldCellBloc>()
|
||||||
|
.add(FieldCellEvent.startUpdateWidth(value.delta.dx));
|
||||||
},
|
},
|
||||||
onHorizontalDragEnd: (end) {
|
onHorizontalDragEnd: (end) {
|
||||||
context.read<FieldCellBloc>().add(const FieldCellEvent.endUpdateWidth());
|
context
|
||||||
|
.read<FieldCellBloc>()
|
||||||
|
.add(const FieldCellEvent.endUpdateWidth());
|
||||||
},
|
},
|
||||||
child: FlowyHover(
|
child: FlowyHover(
|
||||||
|
cursor: SystemMouseCursors.resizeLeftRight,
|
||||||
style: HoverStyle(
|
style: HoverStyle(
|
||||||
hoverColor: theme.main1,
|
hoverColor: theme.main1,
|
||||||
borderRadius: BorderRadius.zero,
|
borderRadius: BorderRadius.zero,
|
||||||
|
@ -9,14 +9,16 @@ class FlowyHover extends StatefulWidget {
|
|||||||
final HoverBuilder? builder;
|
final HoverBuilder? builder;
|
||||||
final Widget? child;
|
final Widget? child;
|
||||||
final bool Function()? setSelected;
|
final bool Function()? setSelected;
|
||||||
|
final MouseCursor? cursor;
|
||||||
|
|
||||||
const FlowyHover({
|
const FlowyHover(
|
||||||
Key? key,
|
{Key? key,
|
||||||
this.builder,
|
this.builder,
|
||||||
this.child,
|
this.child,
|
||||||
required this.style,
|
required this.style,
|
||||||
this.setSelected,
|
this.setSelected,
|
||||||
}) : super(key: key);
|
this.cursor})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<FlowyHover> createState() => _FlowyHoverState();
|
State<FlowyHover> createState() => _FlowyHoverState();
|
||||||
@ -28,7 +30,7 @@ class _FlowyHoverState extends State<FlowyHover> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MouseRegion(
|
return MouseRegion(
|
||||||
cursor: SystemMouseCursors.click,
|
cursor: widget.cursor != null ? widget.cursor! : SystemMouseCursors.click,
|
||||||
opaque: false,
|
opaque: false,
|
||||||
onEnter: (p) => setState(() => _onHover = true),
|
onEnter: (p) => setState(() => _onHover = true),
|
||||||
onExit: (p) => setState(() => _onHover = false),
|
onExit: (p) => setState(() => _onHover = false),
|
||||||
|
Loading…
Reference in New Issue
Block a user