Making bold markdown wrap

This commit is contained in:
Lars Brubaker 2022-03-15 11:21:04 -07:00
parent 6ff1c4fdf8
commit 5ff04ba2f1
6 changed files with 14 additions and 49 deletions

View file

@ -183,7 +183,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
public bool ValidateControls() public bool ValidateControls()
{ {
bool selectionValid = this.SelectedPrinter is AddPrinterWidget.MakeModelInfo selectedPrinter; bool selectionValid = this.SelectedPrinter is MakeModelInfo selectedPrinter;
if (!selectionValid) if (!selectionValid)
{ {

View file

@ -87,7 +87,7 @@ namespace MatterHackers.MatterControl.Library.Widgets.HardwarePage
public bool ShowProducts { get; set; } = true; public bool ShowProducts { get; set; } = true;
public override async void OnLoad(EventArgs args) public override void OnLoad(EventArgs args)
{ {
if (string.IsNullOrEmpty(this.StoreID) if (string.IsNullOrEmpty(this.StoreID)
&& File.Exists(printerInfo.ProfilePath)) && File.Exists(printerInfo.ProfilePath))
@ -166,7 +166,6 @@ namespace MatterHackers.MatterControl.Library.Widgets.HardwarePage
base.OnLoad(args); base.OnLoad(args);
} }
//private void CreateProductDataWidgets(PrinterSettings printerSettings, ProductSkuData product)
private void CreateProductDataWidgets(ProductSkuData product) private void CreateProductDataWidgets(ProductSkuData product)
{ {
var row = new FlowLayoutWidget() var row = new FlowLayoutWidget()
@ -194,12 +193,13 @@ namespace MatterHackers.MatterControl.Library.Widgets.HardwarePage
var description = new MarkdownWidget(theme) var description = new MarkdownWidget(theme)
{ {
MinimumSize = new VectorMath.Vector2(50, 0), MinimumSize = new Vector2(50, 0),
HAnchor = HAnchor.Stretch, HAnchor = HAnchor.Stretch,
VAnchor = VAnchor.Fit, VAnchor = VAnchor.Fit,
AutoScroll = false, AutoScroll = false,
Markdown = product.ProductDescription.Trim() Markdown = product.ProductDescription.Trim()
}; };
descriptionBackground.AddChild(description); descriptionBackground.AddChild(description);
descriptionBackground.BeforeDraw += (s, e) => descriptionBackground.BeforeDraw += (s, e) =>
{ {
@ -245,40 +245,7 @@ namespace MatterHackers.MatterControl.Library.Widgets.HardwarePage
addonsColumn.AddChild(addOnRow); addonsColumn.AddChild(addOnRow);
} }
} }
}
//if (false)
//{
// var settingsPanel = new GuiWidget()
// {
// HAnchor = HAnchor.Stretch,
// VAnchor = VAnchor.Stretch,
// MinimumSize = new VectorMath.Vector2(20, 20),
// DebugShowBounds = true
// };
// settingsPanel.Load += (s, e) =>
// {
// var printer = new PrinterConfig(printerSettings);
// var settingsContext = new SettingsContext(
// printer,
// null,
// NamedSettingsLayers.All);
// settingsPanel.AddChild(
// new ConfigurePrinterWidget(settingsContext, printer, theme)
// {
// HAnchor = HAnchor.Stretch,
// VAnchor = VAnchor.Stretch,
// });
// };
// this.AddChild(new SectionWidget("Settings", settingsPanel, theme, expanded: false, setContentVAnchor: false)
// {
// VAnchor = VAnchor.Stretch
// });
//}
}
private GuiWidget AddHeading(ImageBuffer icon, string text) private GuiWidget AddHeading(ImageBuffer icon, string text)
{ {

View file

@ -30,23 +30,21 @@ either expressed or implied, of the FreeBSD Project.
using MatterHackers.Agg; using MatterHackers.Agg;
using MatterHackers.Agg.UI; using MatterHackers.Agg.UI;
using MatterHackers.MatterControl.PartPreviewWindow; using MatterHackers.MatterControl.PartPreviewWindow;
using System;
namespace MatterHackers.MatterControl.SlicerConfiguration namespace MatterHackers.MatterControl.SlicerConfiguration
{ {
public class ColorField : UIField public class ColorField : UIField
{ {
private ItemColorButton colorWidget; private ItemColorButton colorWidget;
private ThemeConfig theme; private Action<Action<Color>> getPickedColor;
private ThemeConfig theme;
private Color initialColor; private Color initialColor;
public ColorField(ThemeConfig theme) public ColorField(ThemeConfig theme, Color initialColor, Action<Action<Color>> getPickedColor)
{ {
this.getPickedColor = getPickedColor;
this.theme = theme; this.theme = theme;
}
public ColorField(ThemeConfig theme, Color initialColor)
: this(theme)
{
this.initialColor = initialColor; this.initialColor = initialColor;
} }
@ -60,7 +58,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
{ {
var container = new FlowLayoutWidget(); var container = new FlowLayoutWidget();
colorWidget = new ItemColorButton(theme, initialColor); colorWidget = new ItemColorButton(theme, initialColor, getPickedColor);
colorWidget.ColorChanged += (s, e) => colorWidget.ColorChanged += (s, e) =>
{ {
this.SetValue(Color.Html, true); this.SetValue(Color.Html, true);

View file

@ -17,7 +17,7 @@ namespace Markdig.Renderers.Agg
} }
} }
public class ParagraphX : FlowLeftRightWithWrapping public class ParagraphX : FlowLeftRightWithWrapping, IHardBreak
{ {
} }

View file

@ -7,7 +7,7 @@ using MatterHackers.Agg.UI;
namespace Markdig.Renderers.Agg.Inlines namespace Markdig.Renderers.Agg.Inlines
{ {
public class EmphasisInlineX : FlowLayoutWidget public class EmphasisInlineX : FlowLayoutWidget, IWrapChildrenSeparatly
{ {
private char delimiter; private char delimiter;

@ -1 +1 @@
Subproject commit 0ea5548c2bdd91e3daa3769609ead4554e193ea2 Subproject commit e53350017c3b8ebb2c8c028a07f5fe958aecb74a