From ff6e05cb4d15552cffa1fb2f016aa098e586c19e Mon Sep 17 00:00:00 2001 From: Kevin Pope Date: Mon, 27 Oct 2014 19:54:01 -0700 Subject: [PATCH] Set default render to Shaded, if Outlines are not supported. --- ApplicationView/MainApplicationWidget.cs | 55 ++++++++++++++++++++++-- PartPreviewWindow/View3D/View3DWidget.cs | 13 ++++-- 2 files changed, 62 insertions(+), 6 deletions(-) diff --git a/ApplicationView/MainApplicationWidget.cs b/ApplicationView/MainApplicationWidget.cs index 7f8541ffd..c0f4ecc7c 100644 --- a/ApplicationView/MainApplicationWidget.cs +++ b/ApplicationView/MainApplicationWidget.cs @@ -55,6 +55,7 @@ namespace MatterHackers.MatterControl public TopContainerWidget TopContainer; public abstract void AddElements(); + public abstract void HideTopContainer(); public abstract void ToggleTopContainer(); } @@ -64,14 +65,35 @@ namespace MatterHackers.MatterControl CompactTabView widescreenPanel; QueueDataView queueDataView; GuiWidget menuSeparator; + PrintProgressBar progressBar; public CompactApplicationView() { AddElements(); Initialize(); } + + bool topIsHidden = false; + public override void HideTopContainer() + { + if (!topIsHidden) + { + progressBar.WidgetIsExtended = false; + + //To do - Animate this (KP) + this.menuSeparator.Visible = true; + this.TopContainer.Visible = false; + + topIsHidden = true; + } + } public override void ToggleTopContainer() { + + topIsHidden = !topIsHidden; + progressBar.WidgetIsExtended = !progressBar.WidgetIsExtended; + + //To do - Animate this (KP) this.menuSeparator.Visible = this.TopContainer.Visible; this.TopContainer.Visible = !this.TopContainer.Visible; } @@ -100,10 +122,17 @@ namespace MatterHackers.MatterControl TopContainer.SetOriginalHeight(); container.AddChild(TopContainer); - container.AddChild(new PrintProgressBar()); + + progressBar = new PrintProgressBar(); + + container.AddChild(progressBar); container.AddChild(menuSeparator); widescreenPanel = new CompactTabView(queueDataView); - container.AddChild(widescreenPanel); + + BottomOverlay bottomOverlay = new BottomOverlay(); + bottomOverlay.AddChild(widescreenPanel); + + container.AddChild(bottomOverlay); this.AddChild(container); } @@ -130,6 +159,22 @@ namespace MatterHackers.MatterControl } } + class BottomOverlay : GuiWidget + { + public BottomOverlay() + :base() + { + this.AnchorAll(); + + } + + public override void OnMouseDown(MouseEventArgs mouseEvent) + { + base.OnMouseDown(mouseEvent); + ApplicationController.Instance.MainView.HideTopContainer(); + } + } + public class ResponsiveApplicationView : ApplicationView { WidescreenPanel widescreenPanel; @@ -143,6 +188,11 @@ namespace MatterHackers.MatterControl { } + + public override void HideTopContainer() + { + + } public override void AddElements() { @@ -168,7 +218,6 @@ namespace MatterHackers.MatterControl this.AddChild(container); } - void Initialize() { this.AnchorAll(); diff --git a/PartPreviewWindow/View3D/View3DWidget.cs b/PartPreviewWindow/View3D/View3DWidget.cs index 9dd5ae8c4..c99677433 100644 --- a/PartPreviewWindow/View3D/View3DWidget.cs +++ b/PartPreviewWindow/View3D/View3DWidget.cs @@ -1291,9 +1291,16 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { string renderTypeString = UserSettings.Instance.get("defaultRenderSetting"); if (renderTypeString == null) - { - renderTypeString = "Outlines"; - UserSettings.Instance.set("defaultRenderSetting", "Outlines"); + { + if (ActiveTheme.Instance.DisplayMode == ActiveTheme.ApplicationDisplayType.Touchscreen) + { + renderTypeString = "Shaded"; + } + else + { + renderTypeString = "Outlines"; + } + UserSettings.Instance.set("defaultRenderSetting", renderTypeString); } RenderOpenGl.RenderTypes renderType; bool canParse = Enum.TryParse(renderTypeString, out renderType);