Skip to content

Commit

Permalink
fix: properties other than 'style' for custom inline code styles (suc…
Browse files Browse the repository at this point in the history
…h as 'backgroundColor') were not being applied correctly (#2226)
  • Loading branch information
agata authored Sep 14, 2024
1 parent c8b9df5 commit 64011f2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion lib/src/editor/raw_editor/raw_editor_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,8 @@ class QuillRawEditorState extends EditorState
widget.configurations.enableInteractiveSelection,
_hasFocus,
MediaQuery.devicePixelRatioOf(context),
_cursorCont);
_cursorCont,
_styles!.inlineCode!);
return editableTextLine;
}

Expand Down
1 change: 1 addition & 0 deletions lib/src/editor/widgets/text/text_block.dart
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ class EditableTextBlock extends StatelessWidget {
hasFocus,
MediaQuery.devicePixelRatioOf(context),
cursorCont,
styles!.inlineCode!,
);
final nodeTextDirection = getDirectionOfNode(line, textDirection);
children.add(
Expand Down
8 changes: 4 additions & 4 deletions lib/src/editor/widgets/text/text_line.dart
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ class EditableTextLine extends RenderObjectWidget {
this.hasFocus,
this.devicePixelRatio,
this.cursorCont,
this.inlineCodeStyle,
{super.key});

final Line line;
Expand All @@ -656,6 +657,7 @@ class EditableTextLine extends RenderObjectWidget {
final bool hasFocus;
final double devicePixelRatio;
final CursorCont cursorCont;
final InlineCodeStyle inlineCodeStyle;

@override
RenderObjectElement createElement() {
Expand All @@ -664,7 +666,6 @@ class EditableTextLine extends RenderObjectWidget {

@override
RenderObject createRenderObject(BuildContext context) {
final defaultStyles = DefaultStyles.getInstance(context);
return RenderEditableTextLine(
line,
textDirection,
Expand All @@ -675,13 +676,12 @@ class EditableTextLine extends RenderObjectWidget {
_getPadding(),
color,
cursorCont,
defaultStyles.inlineCode!);
inlineCodeStyle);
}

@override
void updateRenderObject(
BuildContext context, covariant RenderEditableTextLine renderObject) {
final defaultStyles = DefaultStyles.getInstance(context);
renderObject
..setLine(line)
..setPadding(_getPadding())
Expand All @@ -692,7 +692,7 @@ class EditableTextLine extends RenderObjectWidget {
..hasFocus = hasFocus
..setDevicePixelRatio(devicePixelRatio)
..setCursorCont(cursorCont)
..setInlineCodeStyle(defaultStyles.inlineCode!);
..setInlineCodeStyle(inlineCodeStyle);
}

EdgeInsetsGeometry _getPadding() {
Expand Down

0 comments on commit 64011f2

Please sign in to comment.