diff --git a/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs b/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs index 89127a019..0c98631f0 100644 --- a/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs +++ b/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs @@ -213,8 +213,8 @@ namespace MatterHackers.MatterControl.ConfigurationPage ApplicationController.Instance.Library.NotifyContainerChanged(); } }, - rebuildThumbnailsMessage, - rebuildThumbnailsTitle, + "You are switching to a different thumbnail rendering mode. If you want, your current thumbnails can be removed and recreated in the new style. You can switch back and forth at any time. There will be some processing overhead while the new thumbnails are created.\n\nDo you want to rebuild your existing thumbnails now?".Localize(), + "Rebuild Thumbnails Now".Localize(), StyledMessageBox.MessageType.YES_NO, "Rebuild".Localize()); }); @@ -418,9 +418,6 @@ namespace MatterHackers.MatterControl.ConfigurationPage return container; } - private string rebuildThumbnailsMessage = "You are switching to a different thumbnail rendering mode. If you want, your current thumbnails can be removed and recreated in the new style. You can switch back and forth at any time. There will be some processing overhead while the new thumbnails are created.\n\nDo you want to rebuild your existing thumbnails now?".Localize(); - private string rebuildThumbnailsTitle = "Rebuild Thumbnails Now".Localize(); - [Conditional("DEBUG")] private void GenerateLocalizationValidationFile() { diff --git a/CustomWidgets/FatFlatClickWidget.cs b/CustomWidgets/FatFlatClickWidget.cs deleted file mode 100644 index 52e78c01c..000000000 --- a/CustomWidgets/FatFlatClickWidget.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright (c) 2014, Kevin Pope -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those -of the authors and should not be interpreted as representing official policies, -either expressed or implied, of the FreeBSD Project. -*/ - -using MatterHackers.Agg.UI; - -namespace MatterHackers.MatterControl -{ - public class FatFlatClickWidget : ClickWidget - { - private GuiWidget overlay; - - public FatFlatClickWidget(TextWidget textWidget) - { - overlay = new GuiWidget(); - overlay.AnchorAll(); - overlay.BackgroundColor = ActiveTheme.Instance.TransparentDarkOverlay; - overlay.Visible = false; - - this.GetChildClicks = true; - - this.AddChild(textWidget); - this.AddChild(overlay); - } - - public override void OnMouseDown(MouseEventArgs mouseEvent) - { - if (PositionWithinLocalBounds(mouseEvent.X, mouseEvent.Y)) - { - overlay.Visible = true; - } - base.OnMouseDown(mouseEvent); - } - - public override void OnMouseLeave(MouseEventArgs mouseEvent) - { - base.OnMouseLeave(mouseEvent); - } - - public override void OnMouseUp(MouseEventArgs mouseEvent) - { - base.OnMouseUp(mouseEvent); - overlay.Visible = false; - } - } -} \ No newline at end of file diff --git a/History/PrintHistoryListItem.cs b/History/PrintHistoryListItem.cs index 2c01c1fc8..90f47d5e5 100644 --- a/History/PrintHistoryListItem.cs +++ b/History/PrintHistoryListItem.cs @@ -102,7 +102,6 @@ namespace MatterHackers.MatterControl.PrintHistory private static int rightOverlayWidth = 200; #endif private int actionButtonSize = rightOverlayWidth/2; - private SlideWidget rightButtonOverlay; public PrintHistoryListItem(ListViewItem listViewItem, int thumbWidth, int thumbHeight, PrintTask printTask, bool showTimestamp, ThemeConfig theme) : base(listViewItem, thumbWidth, thumbHeight, theme) @@ -215,50 +214,6 @@ namespace MatterHackers.MatterControl.PrintHistory primaryContainer.AddChild(primaryFlow); - rightButtonOverlay = new SlideWidget(); - rightButtonOverlay.VAnchor = VAnchor.Stretch; - rightButtonOverlay.HAnchor = Agg.UI.HAnchor.Right; - rightButtonOverlay.Width = rightOverlayWidth; - rightButtonOverlay.Visible = false; - - FlowLayoutWidget rightMiddleColumnContainer = new FlowLayoutWidget(FlowDirection.LeftToRight); - rightMiddleColumnContainer.VAnchor = VAnchor.Stretch; - { - TextWidget viewLabel = new TextWidget("View".Localize()); - viewLabel.TextColor = Color.White; - viewLabel.VAnchor = VAnchor.Center; - viewLabel.HAnchor = HAnchor.Center; - - TextWidget printLabel = new TextWidget("Print".Localize()); - printLabel.TextColor = Color.White; - printLabel.VAnchor = VAnchor.Center; - printLabel.HAnchor = HAnchor.Center; - - FatFlatClickWidget printButton = new FatFlatClickWidget(printLabel); - printButton.VAnchor = VAnchor.Stretch; - printButton.BackgroundColor = ActiveTheme.Instance.PrimaryAccentColor; - printButton.Width = actionButtonSize; - printButton.Click += (sender, e) => - { - UiThread.RunOnIdle(() => - { - if (!ApplicationController.Instance.ActivePrinter.Connection.PrintIsActive) - { - // TODO: More work needed here. We need to stash the bedplate, switch to a new context, then invoke print as normal - //ApplicationController.Instance.PrintActivePartIfPossible(new PrintItemWrapper(printTask.PrintItemId)); - } - else - { - // TODO: Queue is somewhat deprecated. Consider disabling this feature/button while printing - QueueData.Instance.AddItem(new PrintItemWrapper(printTask.PrintItemId)); - } - rightButtonOverlay.SlideOut(); - }); - }; - rightMiddleColumnContainer.AddChild(printButton); - } - rightButtonOverlay.AddChild(rightMiddleColumnContainer); - if (showTimestamp) { FlowLayoutWidget timestampColumn = new FlowLayoutWidget(FlowDirection.TopToBottom); @@ -321,7 +276,6 @@ namespace MatterHackers.MatterControl.PrintHistory } mainContainer.AddChild(primaryContainer); - mainContainer.AddChild(rightButtonOverlay); this.AddChild(mainContainer); } diff --git a/MatterControl.csproj b/MatterControl.csproj index 8e184fa10..4971b0aa2 100644 --- a/MatterControl.csproj +++ b/MatterControl.csproj @@ -270,6 +270,7 @@ + @@ -300,7 +301,6 @@ - @@ -447,7 +447,6 @@ - diff --git a/PartPreviewWindow/PartPreviewContent.cs b/PartPreviewWindow/PartPreviewContent.cs index 80a849667..df93b23f2 100644 --- a/PartPreviewWindow/PartPreviewContent.cs +++ b/PartPreviewWindow/PartPreviewContent.cs @@ -85,21 +85,13 @@ namespace MatterHackers.MatterControl.PartPreviewWindow } }; - // Force the ActionArea to be as high as ButtonHeight tabControl.TabBar.ActionArea.MinimumSize = new Vector2(0, theme.ButtonHeight); tabControl.TabBar.BackgroundColor = theme.TabBarBackground; tabControl.TabBar.BorderColor = theme.ActiveTabColor; // Force common padding into top region - var padding = theme.TabbarPadding; - tabControl.TabBar.Padding = padding.Clone(top: padding.Top * 2, bottom: 0); - - //tabControl.TabBar.Padding = 0; - //tabControl.TabBar.ActionArea.Padding = padding.Clone(top: padding.Top * 2, bottom: 0); - - - Color selectedTabColor = ActiveTheme.Instance.TabLabelSelected; + tabControl.TabBar.Padding = theme.TabbarPadding.Clone(top: theme.TabbarPadding.Top * 2, bottom: 0); // add in a what's new button Button seeWhatsNewButton = theme.LinkButtonFactory.Generate("What's New...".Localize()); diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 6f687c895..737316563 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 6f687c8959a60be2722fb20a19e43a6a2b2cafab +Subproject commit 7373165635f93ce5e178b8de201d8133f52765cc diff --git a/Utilities/MarkdigAgg/MarkdownDocument.cs b/Utilities/MarkdigAgg/AggMarkdownDocument.cs similarity index 94% rename from Utilities/MarkdigAgg/MarkdownDocument.cs rename to Utilities/MarkdigAgg/AggMarkdownDocument.cs index b569e1c8e..19d4cf488 100644 --- a/Utilities/MarkdigAgg/MarkdownDocument.cs +++ b/Utilities/MarkdigAgg/AggMarkdownDocument.cs @@ -43,17 +43,17 @@ namespace Markdig.Agg public string PageID { get; internal set; } } - public class MarkdownDocument + public class AggMarkdownDocument { private string _markDownText = null; private MarkdownPipeline _pipeLine = null; private static readonly MarkdownPipeline DefaultPipeline = new MarkdownPipelineBuilder().UseSupportedExtensions().Build(); - public MarkdownDocument() + public AggMarkdownDocument() { } - public MarkdownDocument(Uri baseUri) + public AggMarkdownDocument(Uri baseUri) { this.BaseUri = baseUri; } @@ -62,13 +62,13 @@ namespace Markdig.Agg public List Children { get; private set; } = new List(); - public static MarkdownDocument Load(Uri uri) + public static AggMarkdownDocument Load(Uri uri) { var webClient = new WebClient(); string rawText = webClient.DownloadString(uri); - return new MarkdownDocument(uri) + return new AggMarkdownDocument(uri) { Markdown = rawText, }; diff --git a/Utilities/MarkdigAgg/AggRenderer.cs b/Utilities/MarkdigAgg/AggRenderer.cs index 3114b5f50..9c86408ba 100644 --- a/Utilities/MarkdigAgg/AggRenderer.cs +++ b/Utilities/MarkdigAgg/AggRenderer.cs @@ -42,7 +42,7 @@ namespace Markdig.Renderers } /// - /// Agg renderer for a Markdown object. + /// Agg renderer for a Markdown object. /// /// public class AggRenderer : RendererBase diff --git a/Utilities/MarkdigAgg/MarkdownWidget.cs b/Utilities/MarkdigAgg/MarkdownWidget.cs index da73cbfcb..0b563dd4a 100644 --- a/Utilities/MarkdigAgg/MarkdownWidget.cs +++ b/Utilities/MarkdigAgg/MarkdownWidget.cs @@ -29,7 +29,6 @@ either expressed or implied, of the FreeBSD Project. using System; using System.Net; -using Markdig.Renderers; using MatterHackers.Agg.UI; using MatterHackers.VectorMath; @@ -37,12 +36,10 @@ namespace Markdig.Agg { public class MarkdownWidget : ScrollableWidget { - private static readonly MarkdownPipeline DefaultPipeline = new MarkdownPipelineBuilder().UseSupportedExtensions().Build(); - private string _markDownText = null; private FlowLayoutWidget contentPanel; - private MarkdownDocument markdownDocument; + private AggMarkdownDocument markdownDocument; public MarkdownWidget(Uri contentUri, bool scrollContent = true) : this(scrollContent) @@ -55,21 +52,13 @@ namespace Markdig.Agg public MarkdownWidget(bool scrollContent = true) : base(scrollContent) { - markdownDocument = new MarkdownDocument(); + markdownDocument = new AggMarkdownDocument(); this.HAnchor = HAnchor.Stretch; this.ScrollArea.HAnchor = HAnchor.Stretch; - if (scrollContent) - { - this.VAnchor = VAnchor.Stretch; - this.ScrollArea.VAnchor = VAnchor.Fit; - } - else - { - this.VAnchor = VAnchor.Fit; - this.ScrollArea.VAnchor = VAnchor.Fit; - } + this.VAnchor = (scrollContent) ? VAnchor.Stretch : VAnchor.Fit; + this.ScrollArea.VAnchor = (scrollContent) ? VAnchor.Fit : VAnchor.Fit; var lastScroll = this.TopLeftOffset; this.ScrollPositionChanged += (s, e) =>