diff --git a/MainWindow.cs b/MainWindow.cs index e3a8b1a..14964a4 100755 --- a/MainWindow.cs +++ b/MainWindow.cs @@ -47,6 +47,7 @@ namespace Buypeeb { private Box selectionViewBox; private Label endingLabel; private bool queueActive; + private SearchEntry searchEntry; private Dictionary filterChecks = new Dictionary(); // ...to here. @@ -108,6 +109,7 @@ namespace Buypeeb { this.selectionViewBox = (Box)builder.GetObject("SelectionViewBox"); this.endingLabel = (Label)builder.GetObject("LabelSelectedEnding"); + this.searchEntry = (SearchEntry)builder.GetObject("FilterSearchEntry"); foreach (var name in new List { "Favourites", "NonFavourites", "Active", "Ended", "EndingToday", "EndingAfterToday", "WithWinPrice", "WithNoWinPrice" }) { this.filterChecks.Add(name, (CheckButton)builder.GetObject($"CheckButtonFilter{name}")); this.filterChecks[name].Active = false; @@ -123,7 +125,10 @@ namespace Buypeeb { (item.endingToday != this.filterChecks["EndingToday"].Active || item.endingToday == this.filterChecks["EndingAfterToday"].Active) && (item.hasWinPrice != this.filterChecks["WithWinPrice"].Active || - item.hasWinPrice == this.filterChecks["WithNoWinPrice"].Active) + item.hasWinPrice == this.filterChecks["WithNoWinPrice"].Active) && + (String.IsNullOrWhiteSpace(this.searchEntry.Text) || + item.name.ToLower().Contains(this.searchEntry.Text.ToLower()) || + item.originalName.ToLower().Contains(this.searchEntry.Text.ToLower())) select item; Console.WriteLine(this.filterChecks["Favourites"].Active); diff --git a/ui/main.glade b/ui/main.glade index e2017a6..f801c00 100644 --- a/ui/main.glade +++ b/ui/main.glade @@ -457,13 +457,15 @@ 3 3 - + True True True edit-find-symbolic False False + + False