mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
fix Custom Plugin Hotkey not deselect text when query text is already custom plugin hotkey
This commit is contained in:
parent
92685d91a3
commit
9b0371c82b
3 changed files with 10 additions and 8 deletions
|
|
@ -79,7 +79,6 @@
|
||||||
Style="{DynamicResource QueryBoxStyle}"
|
Style="{DynamicResource QueryBoxStyle}"
|
||||||
Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||||
PreviewDragOver="OnPreviewDragOver"
|
PreviewDragOver="OnPreviewDragOver"
|
||||||
TextChanged="OnTextChanged"
|
|
||||||
AllowDrop="True"
|
AllowDrop="True"
|
||||||
Visibility="Visible"
|
Visibility="Visible"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,13 @@ namespace Flow.Launcher
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case nameof(MainViewModel.QueryTextCursorMovedToEnd):
|
||||||
|
if (_viewModel.QueryTextCursorMovedToEnd)
|
||||||
|
{
|
||||||
|
MoveQueryTextToEnd();
|
||||||
|
_viewModel.QueryTextCursorMovedToEnd = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
_settings.PropertyChanged += (o, e) =>
|
_settings.PropertyChanged += (o, e) =>
|
||||||
|
|
@ -329,13 +336,9 @@ namespace Flow.Launcher
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnTextChanged(object sender, TextChangedEventArgs e)
|
private void MoveQueryTextToEnd()
|
||||||
{
|
{
|
||||||
if (_viewModel.QueryTextCursorMovedToEnd)
|
QueryTextBox.CaretIndex = QueryTextBox.Text.Length;
|
||||||
{
|
|
||||||
QueryTextBox.CaretIndex = QueryTextBox.Text.Length;
|
|
||||||
_viewModel.QueryTextCursorMovedToEnd = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -289,8 +289,8 @@ namespace Flow.Launcher.ViewModel
|
||||||
/// <param name="queryText"></param>
|
/// <param name="queryText"></param>
|
||||||
public void ChangeQueryText(string queryText)
|
public void ChangeQueryText(string queryText)
|
||||||
{
|
{
|
||||||
QueryTextCursorMovedToEnd = true;
|
|
||||||
QueryText = queryText;
|
QueryText = queryText;
|
||||||
|
QueryTextCursorMovedToEnd = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool LastQuerySelected { get; set; }
|
public bool LastQuerySelected { get; set; }
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue