Merge pull request #2646 from jlewin/design_tools
Use smaller icon view in SaveAs window
This commit is contained in:
commit
76da549ef5
12 changed files with 60 additions and 55 deletions
|
|
@ -162,7 +162,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
internal void ClearActivePrinter()
|
||||
{
|
||||
this.ActivePrinter = emptyPrinter;
|
||||
this.SetActivePrinter(emptyPrinter);
|
||||
}
|
||||
|
||||
public void RefreshActiveInstance(PrinterSettings updatedPrinterSettings)
|
||||
|
|
@ -658,10 +658,12 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
public void ReloadAll()
|
||||
{
|
||||
var reloadingOverlay = new GuiWidget();
|
||||
reloadingOverlay.HAnchor = HAnchor.Stretch;
|
||||
reloadingOverlay.VAnchor = VAnchor.Stretch;
|
||||
reloadingOverlay.BackgroundColor = this.Theme.DarkShade;
|
||||
var reloadingOverlay = new GuiWidget
|
||||
{
|
||||
HAnchor = HAnchor.Stretch,
|
||||
VAnchor = VAnchor.Stretch,
|
||||
BackgroundColor = this.Theme.DarkShade
|
||||
};
|
||||
|
||||
reloadingOverlay.AddChild(new TextWidget("Reloading".Localize() + "...", textColor: Color.White, pointSize: this.Theme.DefaultFontSize * 1.5)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (c) 2014, Lars Brubaker
|
||||
Copyright (c) 2017, Lars Brubaker, John Lewin
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -31,16 +31,15 @@ using System;
|
|||
using System.Diagnostics;
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.MeshVisualizer;
|
||||
|
||||
namespace MatterHackers.MatterControl.CustomWidgets
|
||||
{
|
||||
public class ValueDisplayInfo : GuiWidget
|
||||
public class InlineEditControl : GuiWidget
|
||||
{
|
||||
private TextWidget numberDisplay;
|
||||
private NumberEdit numberEdit;
|
||||
|
||||
public ValueDisplayInfo(string defaultSizeString = "-0000.00", Agg.Font.Justification justification = Agg.Font.Justification.Left)
|
||||
public InlineEditControl(string defaultSizeString = "-0000.00", Agg.Font.Justification justification = Agg.Font.Justification.Left)
|
||||
{
|
||||
double pointSize = 12;
|
||||
numberDisplay = new TextWidget(defaultSizeString, 0, 0, pointSize, justification: justification)
|
||||
|
|
@ -49,6 +49,7 @@ namespace MatterHackers.MatterControl.Library
|
|||
{
|
||||
return item is ILibraryContentItem
|
||||
|| item is SDCardFileItem
|
||||
|| item is PrintHistoryItem
|
||||
|| (item is ILibraryContentStream contentStream
|
||||
&& ApplicationController.Instance.Library.IsContentFileType(contentStream.FileName));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,9 +50,14 @@ namespace MatterHackers.MatterControl.CustomWidgets
|
|||
|
||||
private List<IconViewItem> allIconViews = new List<IconViewItem>();
|
||||
|
||||
public IconListView()
|
||||
public IconListView(int thumbnailSize = -1)
|
||||
: base(FlowDirection.TopToBottom)
|
||||
{
|
||||
if (thumbnailSize != -1)
|
||||
{
|
||||
this.ThumbHeight = thumbnailSize;
|
||||
this.ThumbWidth = thumbnailSize;
|
||||
}
|
||||
}
|
||||
|
||||
private int reflownWidth = -1;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
|
|||
/// <summary>
|
||||
/// The original content view before it was replaced by a container default view
|
||||
/// </summary>
|
||||
private GuiWidget stashedContentView = new IconListView();
|
||||
private GuiWidget stashedContentView;
|
||||
|
||||
// Default constructor uses IconListView
|
||||
public ListView(ILibraryContext context)
|
||||
|
|
|
|||
|
|
@ -623,12 +623,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
AlwaysEnabled = true,
|
||||
Action = (selectedLibraryItems, listView) =>
|
||||
{
|
||||
listView.ListContentView = new IconListView()
|
||||
{
|
||||
ThumbWidth = 256,
|
||||
ThumbHeight = 256,
|
||||
};
|
||||
|
||||
listView.ListContentView = new IconListView(256);
|
||||
listView.Reload().ConfigureAwait(false);
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@
|
|||
<Compile Include="ControlElements\MHPasswordTextEditWidget.cs" />
|
||||
<Compile Include="ControlElements\TextImageWidget.cs" />
|
||||
<Compile Include="CustomWidgets\DockingTabControl.cs" />
|
||||
<Compile Include="CustomWidgets\InlineEditControl.cs" />
|
||||
<Compile Include="CustomWidgets\PrintingWindow\BasicBody.cs" />
|
||||
<Compile Include="CustomWidgets\PrintingWindow\BedStatusWidget.cs" />
|
||||
<Compile Include="CustomWidgets\PrintingWindow\ExtruderStatusWidget.cs" />
|
||||
|
|
@ -104,7 +105,6 @@
|
|||
<Compile Include="CustomWidgets\NamedAction.cs" />
|
||||
<Compile Include="CustomWidgets\RadioImageWidget.cs" />
|
||||
<Compile Include="CustomWidgets\RadioPanelWidget.cs" />
|
||||
<Compile Include="CustomWidgets\ValueDisplayInfo.cs" />
|
||||
<Compile Include="CustomWidgets\DisableablePanel.cs" />
|
||||
<Compile Include="Library\Interfaces\LibraryExtensionMethods.cs" />
|
||||
<Compile Include="Library\Providers\CreateFolderItem.cs" />
|
||||
|
|
|
|||
|
|
@ -70,11 +70,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
this.view3DWidget.ResetView();
|
||||
}
|
||||
};
|
||||
viewControls3D.OverflowMenu.DynamicPopupContent = () =>
|
||||
{
|
||||
return this.GetViewControls3DOverflowMenu();
|
||||
};
|
||||
|
||||
viewControls3D.OverflowMenu.DynamicPopupContent = this.GetViewControls3DOverflowMenu;
|
||||
|
||||
bool isPrinterType = this is PrinterTabPage;
|
||||
|
||||
// The 3D model view
|
||||
|
|
@ -87,21 +84,33 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
this,
|
||||
editorType: (isPrinterType) ? MeshViewerWidget.EditorType.Printer : MeshViewerWidget.EditorType.Part);
|
||||
|
||||
topToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
||||
topToBottom.AnchorAll();
|
||||
this.AddChild(topToBottom);
|
||||
this.AddChild(topToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom)
|
||||
{
|
||||
HAnchor = HAnchor.Stretch,
|
||||
VAnchor = VAnchor.Stretch
|
||||
});
|
||||
|
||||
topToBottom.AddChild(viewControls3D);
|
||||
topToBottom.AddChild(leftToRight = new FlowLayoutWidget()
|
||||
{
|
||||
Name = "View3DContainerParent",
|
||||
HAnchor = HAnchor.Stretch,
|
||||
VAnchor = VAnchor.Stretch
|
||||
});
|
||||
|
||||
leftToRight = new FlowLayoutWidget();
|
||||
leftToRight.Name = "View3DContainerParent";
|
||||
leftToRight.AnchorAll();
|
||||
topToBottom.AddChild(leftToRight);
|
||||
view3DContainer = new GuiWidget()
|
||||
{
|
||||
HAnchor = HAnchor.Stretch,
|
||||
VAnchor = VAnchor.Stretch
|
||||
};
|
||||
|
||||
view3DContainer = new GuiWidget();
|
||||
view3DContainer.AnchorAll();
|
||||
|
||||
view3DContainer.AddChild(view3DWidget);
|
||||
var toolbarAndView3DWidget = new FlowLayoutWidget(FlowDirection.TopToBottom)
|
||||
{
|
||||
HAnchor = HAnchor.Stretch,
|
||||
VAnchor = VAnchor.Stretch
|
||||
};
|
||||
toolbarAndView3DWidget.AddChild(viewControls3D);
|
||||
toolbarAndView3DWidget.AddChild(view3DWidget);
|
||||
view3DContainer.AddChild(toolbarAndView3DWidget);
|
||||
|
||||
leftToRight.AddChild(view3DContainer);
|
||||
|
||||
|
|
|
|||
|
|
@ -37,10 +37,6 @@ using MatterHackers.MatterControl.Library;
|
|||
|
||||
namespace MatterHackers.MatterControl
|
||||
{
|
||||
public class SaveAsContext : LibraryConfig
|
||||
{
|
||||
}
|
||||
|
||||
public class SaveAsPage : DialogPage
|
||||
{
|
||||
private Func<SaveAsReturnInfo, Task> functionToCallOnSaveAs;
|
||||
|
|
@ -61,24 +57,30 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
this.HeaderText = "Save New Design".Localize() + ":";
|
||||
|
||||
libraryNavContext = new SaveAsContext()
|
||||
contentRow.Padding = 0;
|
||||
|
||||
FolderBreadCrumbWidget breadCrumbWidget = null;
|
||||
|
||||
// Create a new library context for the SaveAs view
|
||||
libraryNavContext = new LibraryConfig()
|
||||
{
|
||||
ActiveContainer = ApplicationController.Instance.Library.RootLibaryContainer
|
||||
};
|
||||
libraryNavContext.ContainerChanged += (s, e) =>
|
||||
{
|
||||
saveAsButton.Enabled = libraryNavContext.ActiveContainer is ILibraryWritableContainer;
|
||||
breadCrumbWidget.SetBreadCrumbs(libraryNavContext.ActiveContainer);
|
||||
};
|
||||
|
||||
librarySelectorWidget = new ListView(libraryNavContext)
|
||||
librarySelectorWidget = new ListView(libraryNavContext, new IconListView(75))
|
||||
{
|
||||
BackgroundColor = ActiveTheme.Instance.TertiaryBackgroundColor,
|
||||
ShowItems = false,
|
||||
ContainerFilter = (container) => !container.IsReadOnly
|
||||
ContainerFilter = (container) => !container.IsReadOnly,
|
||||
};
|
||||
|
||||
// put in the bread crumb widget
|
||||
var breadCrumbWidget = new FolderBreadCrumbWidget(librarySelectorWidget);
|
||||
breadCrumbWidget = new FolderBreadCrumbWidget(librarySelectorWidget);
|
||||
contentRow.AddChild(breadCrumbWidget);
|
||||
|
||||
// put in the area to pick the provider to save to
|
||||
|
|
@ -87,9 +89,7 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
HAnchor = HAnchor.Stretch,
|
||||
VAnchor = VAnchor.Stretch,
|
||||
Margin = new BorderDouble(5),
|
||||
BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor,
|
||||
Padding = new BorderDouble(3),
|
||||
};
|
||||
chooseWindow.AddChild(librarySelectorWidget);
|
||||
contentRow.AddChild(chooseWindow);
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
{
|
||||
public static int SliderWidth { get; } = (UserSettings.Instance.IsTouchScreen) ? 20 : 10;
|
||||
|
||||
private ValueDisplayInfo currentLayerInfo;
|
||||
private InlineEditControl currentLayerInfo;
|
||||
|
||||
private LayerScrollbar layerScrollbar;
|
||||
private BedConfig sceneContext;
|
||||
|
|
@ -58,7 +58,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
layerSlider = layerScrollbar.layerSlider;
|
||||
|
||||
currentLayerInfo = new ValueDisplayInfo("1000")
|
||||
currentLayerInfo = new InlineEditControl("1000")
|
||||
{
|
||||
GetDisplayString = (value) => $"{value + 1}",
|
||||
HAnchor = HAnchor.Absolute,
|
||||
|
|
|
|||
|
|
@ -57,14 +57,14 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
private double lineLength = 55;
|
||||
private List<Vector2> lines = new List<Vector2>();
|
||||
private double upArrowSize = 7 * GuiWidget.DeviceScale;
|
||||
private ValueDisplayInfo zHeightDisplayInfo;
|
||||
private InlineEditControl zHeightDisplayInfo;
|
||||
private bool HadClickOnControl;
|
||||
|
||||
public MoveInZControl(IInteractionVolumeContext context)
|
||||
: base(context)
|
||||
{
|
||||
Name = "MoveInZControl";
|
||||
zHeightDisplayInfo = new ValueDisplayInfo()
|
||||
zHeightDisplayInfo = new InlineEditControl()
|
||||
{
|
||||
ForceHide = () =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,14 +28,8 @@ either expressed or implied, of the FreeBSD Project.
|
|||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.Agg.Platform;
|
||||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.MatterControl.SettingsManagement;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue