Made the back button say "Back"

This commit is contained in:
Lars Brubaker 2015-09-14 14:48:13 -07:00
parent b2d6202456
commit 43dc9a65da
2 changed files with 9 additions and 8 deletions

View file

@ -58,7 +58,7 @@ namespace MatterHackers.MatterControl.CustomWidgets.LibrarySelector
public LibrarySelectorWidget libraryDataView { get; private set; }
public LibrarySelectorRowItem(PrintItemCollection collection, int collectionIndex, LibrarySelectorWidget libraryDataView, LibraryProvider parentProvider, GuiWidget thumbnailWidget)
public LibrarySelectorRowItem(PrintItemCollection collection, int collectionIndex, LibrarySelectorWidget libraryDataView, LibraryProvider parentProvider, GuiWidget thumbnailWidget, string openButtonText)
{
this.thumbnailWidget = thumbnailWidget;
this.libraryDataView = libraryDataView;
@ -70,7 +70,7 @@ namespace MatterHackers.MatterControl.CustomWidgets.LibrarySelector
this.Name = this.ItemName + " Row Item Collection";
CreateGuiElements();
CreateGuiElements(openButtonText);
}
public PrintItemCollection PrintItemCollection { get { return printItemCollection; } }
@ -121,7 +121,7 @@ namespace MatterHackers.MatterControl.CustomWidgets.LibrarySelector
this.Margin = new BorderDouble(6, 0, 6, 6);
}
protected SlideWidget GetItemActionButtons()
protected SlideWidget GetItemActionButtons(string openButtonText)
{
SlideWidget buttonContainer = new SlideWidget();
buttonContainer.VAnchor = VAnchor.ParentBottomTop;
@ -129,7 +129,7 @@ namespace MatterHackers.MatterControl.CustomWidgets.LibrarySelector
FlowLayoutWidget buttonFlowContainer = new FlowLayoutWidget(FlowDirection.LeftToRight);
buttonFlowContainer.VAnchor = VAnchor.ParentBottomTop;
TextWidget openLabel = new TextWidget("Open".Localize());
TextWidget openLabel = new TextWidget(openButtonText);
openLabel.TextColor = RGBA_Bytes.White;
openLabel.VAnchor = VAnchor.ParentCenter;
openLabel.HAnchor = HAnchor.ParentCenter;
@ -211,7 +211,7 @@ namespace MatterHackers.MatterControl.CustomWidgets.LibrarySelector
}
}
protected void CreateGuiElements()
protected void CreateGuiElements(string openButtonText)
{
this.Cursor = Cursors.Hand;
@ -255,7 +255,7 @@ namespace MatterHackers.MatterControl.CustomWidgets.LibrarySelector
primaryContainer.AddChild(primaryFlow);
rightButtonOverlay = GetItemActionButtons();
rightButtonOverlay = GetItemActionButtons(openButtonText);
rightButtonOverlay.Visible = false;
mainContainer.AddChild(primaryContainer);

View file

@ -35,6 +35,7 @@ using MatterHackers.MatterControl.DataStorage;
using MatterHackers.MatterControl.PrintLibrary.Provider;
using MatterHackers.MatterControl.PrintQueue;
using MatterHackers.VectorMath;
using MatterHackers.Localizations;
using System;
using System.IO;
@ -375,7 +376,7 @@ namespace MatterHackers.MatterControl.CustomWidgets.LibrarySelector
if (provider.ProviderKey != "ProviderSelectorKey")
{
PrintItemCollection parent = new PrintItemCollection("..", provider.ProviderKey);
LibrarySelectorRowItem queueItem = new LibrarySelectorRowItem(parent, -1, this, provider.ParentLibraryProvider, GetThumbnailWidget(provider.ParentLibraryProvider, parent, LibraryProvider.UpFolderImage));
LibrarySelectorRowItem queueItem = new LibrarySelectorRowItem(parent, -1, this, provider.ParentLibraryProvider, GetThumbnailWidget(provider.ParentLibraryProvider, parent, LibraryProvider.UpFolderImage), "Back".Localize());
AddListItemToTopToBottom(queueItem);
}
@ -384,7 +385,7 @@ namespace MatterHackers.MatterControl.CustomWidgets.LibrarySelector
PrintItemCollection item = provider.GetCollectionItem(i);
if (item.Key != "LibraryProviderPurchasedKey")
{
LibrarySelectorRowItem queueItem = new LibrarySelectorRowItem(item, i, this, null, GetThumbnailWidget(null, item, provider.GetCollectionFolderImage(i)));
LibrarySelectorRowItem queueItem = new LibrarySelectorRowItem(item, i, this, null, GetThumbnailWidget(null, item, provider.GetCollectionFolderImage(i)), "Open".Localize());
AddListItemToTopToBottom(queueItem);
}
}