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.

feat: customizes quoted text style

Lucas.Xu25387cd0b05e
diff --git a/frontend/app_flowy/packages/flowy_editor/lib/infra/flowy_svg.dart b/frontend/app_flowy/packages/flowy_editor/lib/infra/flowy_svg.dart
index 12da5b5dc8..d38fe2d16d 100644
--- a/frontend/app_flowy/packages/flowy_editor/lib/infra/flowy_svg.dart
+++ b/frontend/app_flowy/packages/flowy_editor/lib/infra/flowy_svg.dart
@@ -18,12 +18,14 @@ class FlowySvg extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (name != null) {
- return SvgPicture.asset(
- 'assets/images/$name.svg',
- color: color,
- package: 'flowy_editor',
- width: size.width,
- height: size.width,
+ return SizedBox.fromSize(
+ size: size,
+ child: SvgPicture.asset(
+ 'assets/images/$name.svg',
+ color: color,
+ package: 'flowy_editor',
+ fit: BoxFit.fill,
+ ),
);
} else if (number != null) {
final numberText =
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 f7b79342b8..eb03846711 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
@@ -158,6 +158,7 @@ class _FlowyRichTextState extends State<FlowyRichText> with Selectable {
color: widget.textNode.toRawString().isNotEmpty
? Colors.transparent
: Colors.grey,
+ fontSize: baseFontSize,
),
),
],
diff --git a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/quoted_text.dart b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/quoted_text.dart
index e2a43058c8..a3b6d2ca79 100644
--- a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/quoted_text.dart
+++ b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/quoted_text.dart
@@ -59,7 +59,10 @@ class _QuotedTextNodeWidgetState extends State<QuotedTextNodeWidget>
return Row(
children: [
FlowySvg(
- size: Size.square(leftPadding),
+ size: Size(
+ leftPadding,
+ _quoteHeight,
+ ),
name: 'quote',
),
FlowyRichText(
@@ -71,4 +74,10 @@ class _QuotedTextNodeWidgetState extends State<QuotedTextNodeWidget>
],
);
}
+
+ double get _quoteHeight {
+ final lines =
+ widget.textNode.toRawString().characters.where((c) => c == '\n').length;
+ return (lines + 1) * leftPadding;
+ }
}