Keep show folders open if opened
This commit is contained in:
parent
32195ccdb4
commit
3504c57c77
4 changed files with 13 additions and 15 deletions
|
|
@ -85,8 +85,6 @@ namespace MatterHackers.MatterControl.CustomWidgets
|
|||
}, ref unregisterEvents);
|
||||
}
|
||||
|
||||
public bool ShowContainers { get; set; } = true;
|
||||
|
||||
public bool ShowItems { get; set; } = true;
|
||||
|
||||
public Predicate<ILibraryContainerLink> ContainerFilter { get; set; } = (o) => true;
|
||||
|
|
@ -168,7 +166,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
|
|||
int height = itemsContentView.ThumbHeight;
|
||||
|
||||
// Folder items
|
||||
if (this.ShowContainers)
|
||||
if (UserSettings.Instance.get("ShowContainers") == "1")
|
||||
{
|
||||
foreach (var childContainer in sourceContainer.ChildContainers.Where(c => c.IsVisible && this.ContainerFilter(c)))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -78,7 +78,6 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
libraryView = new ListView(ApplicationController.Instance.Library)
|
||||
{
|
||||
BackgroundColor = ActiveTheme.Instance.TertiaryBackgroundColor,
|
||||
ShowContainers = false
|
||||
};
|
||||
|
||||
libraryView.SelectedItems.CollectionChanged += SelectedItems_CollectionChanged;
|
||||
|
|
@ -94,11 +93,11 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
CheckBox showFolders = new CheckBox("Folders")
|
||||
{
|
||||
Name = "Show Folders Toggle",
|
||||
Checked = libraryView.ShowContainers
|
||||
Checked = UserSettings.Instance.get("ShowContainers") == "1"
|
||||
};
|
||||
showFolders.CheckedStateChanged += (s, e) =>
|
||||
{
|
||||
libraryView.ShowContainers = showFolders.Checked;
|
||||
UserSettings.Instance.set("ShowContainers", showFolders.Checked ? "1" : "0");
|
||||
libraryView.Reload();
|
||||
};
|
||||
allControls.AddChild(showFolders);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue