提交 2ce0326f authored 作者: Mitch Capper's avatar Mitch Capper

Reset contact search bar string on escape or dial

上级 01a463e0
......@@ -229,7 +229,7 @@ namespace FSClient {
public void DialString(String str){
if (string.IsNullOrWhiteSpace(str))
return;
MainWindowRemoveFocus();
MainWindowRemoveFocus(true);
if (str.StartsWith("#") && str.Length > 2) {
String acct_num = str.Substring(1, 1);
......@@ -572,8 +572,8 @@ namespace FSClient {
public OurAutoCompleteBox GetContactSearchBox() {
return MainWindow.get_instance().GetContactSearchBox();
}
public void MainWindowRemoveFocus(){
MainWindow.get_instance().RemoveFocus();
public void MainWindowRemoveFocus(bool ResetContactSearchText=false){
MainWindow.get_instance().RemoveFocus(ResetContactSearchText);
}
private delegate void BroadcastEventDel(FSEvent evt);
BroadcastEventDel BroadcastHandler;
......
......@@ -268,8 +268,10 @@ namespace FSClient {
}
public void RemoveFocus(){
public void RemoveFocus(bool ResetContactSearchText=false){
btnMute.Focus(); //should really divert focus a better way
if (ResetContactSearchText)
ResetContactSearchStr();
}
......@@ -424,10 +426,11 @@ namespace FSClient {
return txtSearchBox;
}
private const string contact_search_text = "Contact Search";
private void txtSearchBox_GotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) {
text_interception_enabled = false;
txtSearchBox.Opacity = 1;
if (txtSearchBox.Text == "Contact Search")
if (txtSearchBox.Text == contact_search_text)
txtSearchBox.Text = "";
}
......@@ -436,7 +439,10 @@ namespace FSClient {
txtSearchBox.Opacity = 0.8;
if (String.IsNullOrWhiteSpace(txtSearchBox.Text))
txtSearchBox.Text = "Contact Search";
ResetContactSearchStr();
}
public void ResetContactSearchStr(){
txtSearchBox.Text = contact_search_text;
}
private bool ContactMenuOpen;
......
......@@ -150,7 +150,7 @@ namespace FSClient
if (e.Key == Key.Enter)
call_current_contact();
else if (e.Key == Key.Escape)
Broker.get_instance().MainWindowRemoveFocus();
Broker.get_instance().MainWindowRemoveFocus(true);
}
protected OurAutoCompleteBox search_box;
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论