From bcade13db8c8b9f9fc335ff3dc5df86a49531d9f Mon Sep 17 00:00:00 2001 From: Cierra_Runis <2864283875@qq.com> Date: Sun, 19 May 2024 02:17:58 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7Fix=20`readOnlyMouseCursor`=20losin?= =?UTF-8?q?g=20in=20construction=20function=20(#1875)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/models/config/editor/editor_configurations.dart | 4 ++++ .../models/config/raw_editor/raw_editor_configurations.dart | 3 ++- lib/src/widgets/editor/editor.dart | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/src/models/config/editor/editor_configurations.dart b/lib/src/models/config/editor/editor_configurations.dart index 92c71fbb..74cc66c8 100644 --- a/lib/src/models/config/editor/editor_configurations.dart +++ b/lib/src/models/config/editor/editor_configurations.dart @@ -80,6 +80,7 @@ class QuillEditorConfigurations extends Equatable { this.enableScribble = false, this.onScribbleActivated, this.scribbleAreaInsets, + this.readOnlyMouseCursor = SystemMouseCursors.text, }); final QuillSharedConfigurations sharedConfigurations; @@ -157,6 +158,9 @@ class QuillEditorConfigurations extends Equatable { final bool? showCursor; final bool? paintCursorAboveText; + /// The [readOnlyMouseCursor] is used for Windows, macOS when [readOnly] is [true] + final MouseCursor readOnlyMouseCursor; + /// Whether to enable user interface affordances for changing the /// text selection. /// diff --git a/lib/src/models/config/raw_editor/raw_editor_configurations.dart b/lib/src/models/config/raw_editor/raw_editor_configurations.dart index 51906cfe..b774b9a2 100644 --- a/lib/src/models/config/raw_editor/raw_editor_configurations.dart +++ b/lib/src/models/config/raw_editor/raw_editor_configurations.dart @@ -85,6 +85,7 @@ class QuillRawEditorConfigurations extends Equatable { this.enableScribble = false, this.onScribbleActivated, this.scribbleAreaInsets, + this.readOnlyMouseCursor = SystemMouseCursors.text, }); /// Controls the document being edited. @@ -177,7 +178,7 @@ class QuillRawEditorConfigurations extends Equatable { final CursorStyle cursorStyle; /// The [readOnlyMouseCursor] is used for Windows, macOS when [readOnly] is [true] - final MouseCursor readOnlyMouseCursor = SystemMouseCursors.text; + final MouseCursor readOnlyMouseCursor; /// Configures how the platform keyboard will select an uppercase or /// lowercase keyboard. diff --git a/lib/src/widgets/editor/editor.dart b/lib/src/widgets/editor/editor.dart index a68d15ce..6a1d58e0 100644 --- a/lib/src/widgets/editor/editor.dart +++ b/lib/src/widgets/editor/editor.dart @@ -290,6 +290,7 @@ class QuillEditorState extends State enableScribble: configurations.enableScribble, onScribbleActivated: configurations.onScribbleActivated, scribbleAreaInsets: configurations.scribbleAreaInsets, + readOnlyMouseCursor: configurations.readOnlyMouseCursor, ), ), ),