From f3d1d270f5d527d166a88a9d3a70039b6cfd3888 Mon Sep 17 00:00:00 2001 From: Peterson Fernandes Date: Tue, 19 Mar 2024 02:37:08 -0300 Subject: [PATCH] Improve search functionality and pagination reset The search box now clears when a different system is selected, enhancing the app's usability. Additionally, the pagination reset action has been moved to trigger at the start of the LoadGameFiles function. This change allows for better reliability and consistency in user interactions, as the search function no longer handles the pagination reset. --- SimpleLauncher/MainWindow.xaml.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SimpleLauncher/MainWindow.xaml.cs b/SimpleLauncher/MainWindow.xaml.cs index 56d4d5c..01ffbce 100644 --- a/SimpleLauncher/MainWindow.xaml.cs +++ b/SimpleLauncher/MainWindow.xaml.cs @@ -179,6 +179,7 @@ private void MainWindow_Restart() private void SystemComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { + SearchTextBox.Text = ""; EmulatorComboBox.ItemsSource = null; EmulatorComboBox.SelectedIndex = -1; @@ -256,6 +257,9 @@ private void EmulatorComboBox_SelectionChanged(object sender, SelectionChangedEv private async Task LoadGameFiles(string startLetter = null, string searchQuery = null) { + // Ensure pagination is reset at the beginning + ResetPaginationButtons(); + try { GameFileGrid.Children.Clear(); @@ -493,9 +497,6 @@ public static async void HandleError(Exception ex, string message) private async void SearchButton_Click(object sender, RoutedEventArgs e) { - // Reset pagination controls - ResetPaginationButtons(); - var searchQuery = SearchTextBox.Text.Trim(); if (SystemComboBox.SelectedItem == null)