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 WindowLocation;
|
||||||
public Point WindowPosition;
|
public Point WindowPosition;
|
||||||
public Size WindowSize;
|
public Size WindowSize;
|
||||||
public string ConfigEditorSearch = "";
|
public string ConfigEditorSearch = "Video:";
|
||||||
public string Mute = "no";
|
public string Mute = "no";
|
||||||
public string UpdateCheckVersion = "";
|
public string UpdateCheckVersion = "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,10 +63,10 @@ namespace mpvnet
|
|||||||
switch (setting)
|
switch (setting)
|
||||||
{
|
{
|
||||||
case StringSetting s:
|
case StringSetting s:
|
||||||
MainStackPanel.Children.Add(new StringSettingControl(s));
|
MainStackPanel.Children.Add(new StringSettingControl(s) { Visibility = Visibility.Collapsed });
|
||||||
break;
|
break;
|
||||||
case OptionSetting s:
|
case OptionSetting s:
|
||||||
MainStackPanel.Children.Add(new OptionSettingControl(s));
|
MainStackPanel.Children.Add(new OptionSettingControl(s) { Visibility = Visibility.Collapsed });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -277,15 +277,16 @@ namespace mpvnet
|
|||||||
void SearchTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
void SearchTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
{
|
{
|
||||||
string activeFilter = "";
|
string activeFilter = "";
|
||||||
|
string searchText = SearchControl.Text;
|
||||||
|
|
||||||
foreach (var i in FilterStrings)
|
foreach (string i in FilterStrings)
|
||||||
if (SearchControl.Text == i + ":")
|
if (searchText == i + ":")
|
||||||
activeFilter = i;
|
activeFilter = i;
|
||||||
|
|
||||||
if (activeFilter == "")
|
if (activeFilter == "")
|
||||||
{
|
{
|
||||||
foreach (UIElement i in MainStackPanel.Children)
|
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;
|
i.Visibility = Visibility.Visible;
|
||||||
else
|
else
|
||||||
i.Visibility = Visibility.Collapsed;
|
i.Visibility = Visibility.Collapsed;
|
||||||
|
|||||||
Reference in New Issue
Block a user