Skip to content

Commit 53a48fb

Browse files
author
Juan Osorio
committed
MarkdownTextBlock: Minor style improvements
1 parent ba694e0 commit 53a48fb

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

components/MarkdownTextBlock/src/TextElements/MyHeading.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public MyHeading(HeadingBlock headingBlock, MarkdownConfig config)
4747
5 => _config.Themes.H5FontWeight,
4848
_ => _config.Themes.H6FontWeight,
4949
};
50+
_paragraph.Margin = new Thickness(left: 0, top: 14, right: 0, bottom: 0);
5051
}
5152

5253
public MyHeading(HtmlNode htmlNode, MarkdownConfig config)

components/MarkdownTextBlock/src/TextElements/MyList.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,16 @@ public MyList(ListBlock listBlock)
4545
}
4646

4747
_stackPanel.Orientation = Orientation.Vertical;
48+
_stackPanel.Margin = new Thickness(left: 0, top: 8, right: 0, bottom: 8);
4849
_container.Child = _stackPanel;
4950
_paragraph.Inlines.Add(_container);
5051
}
5152

5253
public void AddChild(IAddChild child)
5354
{
5455
var grid = new Grid();
55-
grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Auto) });
56+
grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(20, GridUnitType.Pixel) });
57+
grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(10, GridUnitType.Pixel) });
5658
grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
5759
string bullet;
5860
if (_isOrdered)
@@ -79,11 +81,12 @@ public void AddChild(IAddChild child)
7981
};
8082
textBlock.SetValue(Grid.ColumnProperty, 0);
8183
textBlock.VerticalAlignment = VerticalAlignment.Top;
84+
textBlock.TextAlignment = TextAlignment.Right;
8285
grid.Children.Add(textBlock);
8386
var flowDoc = new MyFlowDocument();
8487
flowDoc.AddChild(child);
8588

86-
flowDoc.RichTextBlock.SetValue(Grid.ColumnProperty, 1);
89+
flowDoc.RichTextBlock.SetValue(Grid.ColumnProperty, 2);
8790
flowDoc.RichTextBlock.Padding = new Thickness(0);
8891
flowDoc.RichTextBlock.VerticalAlignment = VerticalAlignment.Top;
8992
grid.Children.Add(flowDoc.RichTextBlock);

components/MarkdownTextBlock/src/TextElements/MyThematicBreak.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ public MyThematicBreak(ThematicBreakBlock thematicBreakBlock)
2222
_paragraph = new Paragraph();
2323

2424
var inlineUIContainer = new InlineUIContainer();
25-
var border = new Border();
26-
border.Width = 500;
27-
border.BorderThickness = new Thickness(1);
28-
border.Margin = new Thickness(0, 4, 0, 4);
29-
border.BorderBrush = new SolidColorBrush(Colors.Gray);
30-
border.Height = 1;
31-
border.HorizontalAlignment = HorizontalAlignment.Stretch;
32-
inlineUIContainer.Child = border;
25+
Line line = new Line
26+
{
27+
Stretch = Stretch.Fill,
28+
Stroke = new SolidColorBrush(Colors.Gray),
29+
X2 = 1,
30+
Margin = new Thickness(0, 12, 0, 12)
31+
};
32+
inlineUIContainer.Child = line;
3333
_paragraph.Inlines.Add(inlineUIContainer);
3434
}
3535

0 commit comments

Comments
 (0)