From 6dcf3b3fa747116c890ca708c0837669641a6462 Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Mon, 8 Aug 2022 20:34:26 +0800 Subject: [PATCH] feat: set mouse cursor style to text when hovering on the text node --- .../lib/render/rich_text/flowy_rich_text.dart | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/flowy_rich_text.dart b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/flowy_rich_text.dart index 366942ee6c..6250c62db2 100644 --- a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/flowy_rich_text.dart +++ b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/flowy_rich_text.dart @@ -35,7 +35,7 @@ class FlowyRichText extends StatefulWidget { this.cursorHeight, this.cursorWidth = 2.0, this.textSpanDecorator, - this.placeholderText = 'Type \'/\' for commands', + this.placeholderText = ' ', this.placeholderTextSpanDecorator, required this.textNode, required this.editorState, @@ -138,11 +138,16 @@ class _FlowyRichTextState extends State with Selectable { } Widget _buildRichText(BuildContext context) { - return Stack( - children: [ - _buildPlaceholderText(context), - _buildSingleRichText(context), - ], + return MouseRegion( + cursor: SystemMouseCursors.text, + child: widget.textNode.toRawString().isEmpty + ? Stack( + children: [ + _buildPlaceholderText(context), + _buildSingleRichText(context), + ], + ) + : _buildSingleRichText(context), ); }