require at least 2 characters in conf editor search
This commit is contained in:
@@ -21,7 +21,7 @@ namespace mpvnet
|
||||
public Point WindowLocation;
|
||||
public Point WindowPosition;
|
||||
public Size WindowSize;
|
||||
public string ConfigEditorSearch = "";
|
||||
public string ConfigEditorSearch = "Video:";
|
||||
public string Mute = "no";
|
||||
public string UpdateCheckVersion = "";
|
||||
}
|
||||
|
||||
@@ -63,10 +63,10 @@ namespace mpvnet
|
||||
switch (setting)
|
||||
{
|
||||
case StringSetting s:
|
||||
MainStackPanel.Children.Add(new StringSettingControl(s));
|
||||
MainStackPanel.Children.Add(new StringSettingControl(s) { Visibility = Visibility.Collapsed });
|
||||
break;
|
||||
case OptionSetting s:
|
||||
MainStackPanel.Children.Add(new OptionSettingControl(s));
|
||||
MainStackPanel.Children.Add(new OptionSettingControl(s) { Visibility = Visibility.Collapsed });
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -277,15 +277,16 @@ namespace mpvnet
|
||||
void SearchTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
string activeFilter = "";
|
||||
string searchText = SearchControl.Text;
|
||||
|
||||
foreach (var i in FilterStrings)
|
||||
if (SearchControl.Text == i + ":")
|
||||
foreach (string i in FilterStrings)
|
||||
if (searchText == i + ":")
|
||||
activeFilter = i;
|
||||
|
||||
if (activeFilter == "")
|
||||
{
|
||||
foreach (UIElement i in MainStackPanel.Children)
|
||||
if ((i as ISettingControl).Contains(SearchControl.Text))
|
||||
if ((i as ISettingControl).Contains(searchText) && searchText.Length > 1)
|
||||
i.Visibility = Visibility.Visible;
|
||||
else
|
||||
i.Visibility = Visibility.Collapsed;
|
||||
|
||||
Reference in New Issue
Block a user