Make the bread crumbs show we are in search.
This commit is contained in:
parent
2f462254c4
commit
2dfa2dae20
2 changed files with 21 additions and 1 deletions
|
|
@ -52,10 +52,13 @@ namespace MatterHackers.MatterControl.CustomWidgets.LibrarySelector
|
|||
|
||||
public void SetBreadCrumbs(LibraryProvider previousLibraryProvider, LibraryProvider currentLibraryProvider)
|
||||
{
|
||||
LibraryProvider displayingProvider = currentLibraryProvider;
|
||||
|
||||
navigationButtonFactory.normalTextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
navigationButtonFactory.hoverTextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
navigationButtonFactory.pressedTextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
navigationButtonFactory.disabledTextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
navigationButtonFactory.disabledFillColor = navigationButtonFactory.normalFillColor;
|
||||
navigationButtonFactory.Margin = new BorderDouble(10, 0);
|
||||
|
||||
this.CloseAndRemoveAllChildren();
|
||||
|
|
@ -67,6 +70,8 @@ namespace MatterHackers.MatterControl.CustomWidgets.LibrarySelector
|
|||
currentLibraryProvider = currentLibraryProvider.ParentLibraryProvider;
|
||||
}
|
||||
|
||||
bool haveFilterRunning = displayingProvider.KeywordFilter != null && displayingProvider.KeywordFilter != "";
|
||||
|
||||
bool first = true;
|
||||
for (int i = parentProviderList.Count - 1; i >= 0; i--)
|
||||
{
|
||||
|
|
@ -92,6 +97,18 @@ namespace MatterHackers.MatterControl.CustomWidgets.LibrarySelector
|
|||
first = false;
|
||||
}
|
||||
|
||||
if (haveFilterRunning)
|
||||
{
|
||||
GuiWidget separator = new TextWidget(">", textColor: ActiveTheme.Instance.PrimaryTextColor);
|
||||
separator.VAnchor = VAnchor.ParentCenter;
|
||||
separator.Margin = new BorderDouble(0);
|
||||
this.AddChild(separator);
|
||||
|
||||
Button cancelSearch = navigationButtonFactory.Generate("Search Results");
|
||||
cancelSearch.Margin = new BorderDouble(3, 0);
|
||||
this.AddChild(cancelSearch);
|
||||
}
|
||||
|
||||
// while all the buttons don't fit in the control
|
||||
if (this.Parent.Width > 0
|
||||
&& this.Children.Count > 4
|
||||
|
|
|
|||
|
|
@ -188,7 +188,8 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
private void ClearSearchWidget(LibraryProvider previousLibraryProvider, LibraryProvider currentLibraryProvider)
|
||||
{
|
||||
previousLibraryProvider.KeywordFilter = "";
|
||||
searchInput.Text = "";
|
||||
searchInput.Text = currentLibraryProvider.KeywordFilter;
|
||||
breadCrumbWidget.SetBreadCrumbs(null, currentPrintLibraryWidget.libraryDataView.CurrentLibraryProvider);
|
||||
}
|
||||
|
||||
private static void AddLibraryButtonElements()
|
||||
|
|
@ -393,6 +394,8 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
string searchText = searchInput.Text.Trim();
|
||||
|
||||
libraryDataView.CurrentLibraryProvider.KeywordFilter = searchText;
|
||||
|
||||
breadCrumbWidget.SetBreadCrumbs(null, currentPrintLibraryWidget.libraryDataView.CurrentLibraryProvider);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue