diff --git a/Diffusion.Database/Filter.cs b/Diffusion.Database/Filter.cs index 80d17cf..cf7822b 100644 --- a/Diffusion.Database/Filter.cs +++ b/Diffusion.Database/Filter.cs @@ -2,6 +2,7 @@ public class Filter { + public bool UsePrompt { get; set; } public string Prompt { get; set; } public bool UseNegativePrompt { get; set; } @@ -82,8 +83,12 @@ public class Filter UseCreationDate || UseHyperNet || UseHyperNetStr || - UseNoMetadata); + UseNoMetadata || + UseAlbum || + UseFolder); + public bool UseFolder => !string.IsNullOrEmpty(Folder); public string? Folder { get; set; } + public bool UseAlbum => !string.IsNullOrEmpty(Album); public string? Album { get; set; } } \ No newline at end of file diff --git a/Diffusion.Toolkit/Models/SearchModel.cs b/Diffusion.Toolkit/Models/SearchModel.cs index 85618e5..9756b61 100644 --- a/Diffusion.Toolkit/Models/SearchModel.cs +++ b/Diffusion.Toolkit/Models/SearchModel.cs @@ -40,8 +40,8 @@ public class SearchModel : BaseNotify private ICommand _showFilter; private bool _isFilterVisible; private SearchControlModel _filter; - private ICommand _doFilter; - private ICommand _clearFilter; + private ICommand _filterCommand; + private ICommand _clearCommand; private string _sortBy; private string _sortDirection; private ICommand _openCommand; @@ -273,16 +273,16 @@ public SearchControlModel Filter set => SetField(ref _filter, value); } - public ICommand DoFilter + public ICommand FilterCommand { - get => _doFilter; - set => SetField(ref _doFilter, value); + get => _filterCommand; + set => SetField(ref _filterCommand, value); } - public ICommand ClearFilter + public ICommand ClearCommand { - get => _clearFilter; - set => SetField(ref _clearFilter, value); + get => _clearCommand; + set => SetField(ref _clearCommand, value); } public string SortBy diff --git a/Diffusion.Toolkit/Pages/Search.xaml b/Diffusion.Toolkit/Pages/Search.xaml index 0f1959e..ea1ffd4 100644 --- a/Diffusion.Toolkit/Pages/Search.xaml +++ b/Diffusion.Toolkit/Pages/Search.xaml @@ -195,14 +195,14 @@ - + - - + + diff --git a/Diffusion.Toolkit/Pages/Search.xaml.cs b/Diffusion.Toolkit/Pages/Search.xaml.cs index f600d96..bfe559c 100644 --- a/Diffusion.Toolkit/Pages/Search.xaml.cs +++ b/Diffusion.Toolkit/Pages/Search.xaml.cs @@ -30,6 +30,8 @@ namespace Diffusion.Toolkit.Pages { + public class AlbumListBox : DragAndDropListBox { } + public class ModeSettings { public ModeSettings() @@ -195,14 +197,16 @@ public Search(NavigatorService navigatorService, IOptions dataStoreOp _model.HideDropDown = new RelayCommand((o) => SearchTermTextBox.IsDropDownOpen = false); _model.ShowFilter = new RelayCommand((o) => _model.IsFilterVisible = !_model.IsFilterVisible); - _model.DoFilter = new RelayCommand((o) => + + _model.FilterCommand = new RelayCommand((o) => { _model.IsFilterVisible = false; _model.SearchText = "(filtered)"; UseFilter = true; SearchImages(null); }); - _model.ClearFilter = new RelayCommand((o) => + + _model.ClearCommand = new RelayCommand((o) => { _model.Filter.Clear(); @@ -324,6 +328,7 @@ public Search(NavigatorService navigatorService, IOptions dataStoreOp DataContext = _model; ThumbnailListView.DataStoreOptions = _dataStoreOptions; + ThumbnailListView.MessagePopupManager = messagePopupManager; PreviewPane.MainModel = mainModel; @@ -333,21 +338,25 @@ public Search(NavigatorService navigatorService, IOptions dataStoreOp DataStore.SetNSFW(id, b); Update(id); }; + PreviewPane.Favorite = (id, b) => { DataStore.SetFavorite(id, b); Update(id); }; + PreviewPane.Rate = (id, b) => { DataStore.SetRating(id, b); Update(id); }; + PreviewPane.Delete = (id, b) => { DataStore.SetDeleted(id, b); Update(id); }; + //PreviewPane.OnNext = Next; //PreviewPane.OnPrev = Prev; GetRandomHint(); @@ -1755,5 +1764,6 @@ private void PreviewPane_OnPreviewKeyDown(object sender, KeyEventArgs e) { ExtOnKeyDown(this, e); } + } }