Revise RenameButtonRenamesLocalLibraryFolder test
- Restore support for LocalLibrary -> Create Folder - Share Selection logic between Row/Icon views - Make folders selectable - Improve naming of DirectoryContainerLink
This commit is contained in:
parent
fce8d8b813
commit
dd9e2d30b5
8 changed files with 97 additions and 113 deletions
|
|
@ -138,6 +138,33 @@ namespace MatterHackers.MatterControl.CustomWidgets
|
|||
SetItemThumbnail(thumbnail);
|
||||
}
|
||||
|
||||
internal void OnItemSelect()
|
||||
{
|
||||
bool isContentItem = listViewItem.Model is ILibraryContentItem;
|
||||
bool isValidStream = (listViewItem.Model is ILibraryContentStream stream
|
||||
&& ApplicationController.Instance.Library.IsContentFileType(stream.FileName));
|
||||
bool isContainerLink = listViewItem.Model is ILibraryContainerLink;
|
||||
|
||||
if (isContentItem || isValidStream || isContainerLink)
|
||||
{
|
||||
if (this.IsSelected)
|
||||
{
|
||||
listViewItem.ListView.SelectedItems.Remove(listViewItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Keyboard.IsKeyDown(Keys.ControlKey))
|
||||
{
|
||||
listViewItem.ListView.SelectedItems.Clear();
|
||||
}
|
||||
|
||||
listViewItem.ListView.SelectedItems.Add(listViewItem);
|
||||
}
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
protected void SetItemThumbnail(ImageBuffer thumbnail, bool colorize = false)
|
||||
{
|
||||
if (thumbnail != null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue