putting back in banner

This commit is contained in:
Lars Brubaker 2018-03-14 17:45:51 -07:00
parent 6b5859e76b
commit edaa965ade
2 changed files with 28 additions and 2 deletions

View file

@ -256,8 +256,34 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.PlusTab
{
foreach (var content in contentList.Content)
{
switch (content.content_type)
switch (content.content_type)
{
case "banner_image":
{
if ((content.theme_filter == "dark" && ActiveTheme.Instance.IsDarkTheme)
|| (content.theme_filter == "light" && !ActiveTheme.Instance.IsDarkTheme))
{
ImageBuffer image = new ImageBuffer(640, 480);
ResponsiveImageWidget imageWidget = new ResponsiveImageWidget(image)
{
Margin = new BorderDouble(5),
};
if (content.link != null)
{
imageWidget.Cursor = Cursors.Hand;
imageWidget.Click += (s, e) =>
{
ApplicationController.Instance.LaunchBrowser(content.link);
};
}
imageWidget.Load += (s, e) => ApplicationController.Instance.DownloadToImageAsync(image, content.image_url, false, new BlenderPreMultBGRA());
topToBottom.AddChild(imageWidget);
}
}
break;
case "article_group":
case "product_group":
topToBottom.AddChild(new ExploreSection(content, theme));

@ -1 +1 @@
Subproject commit 9d4a2ac1a2a1fc44ecf5a551cde59db213c334de
Subproject commit 44ce9ce3f64b93cf8f103fda679cf1ca275d8b3e