Set default render to Shaded, if Outlines are not supported.

This commit is contained in:
Kevin Pope 2014-10-27 19:54:01 -07:00
parent a01ac75979
commit ff6e05cb4d
2 changed files with 62 additions and 6 deletions

View file

@ -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();

View file

@ -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<RenderOpenGl.RenderTypes>(renderTypeString, out renderType);