Enable mouse wheel in commit message TextBox

This commit is contained in:
leo 2020-07-13 09:45:34 +08:00
parent 1587e65479
commit e8ef47f33d
2 changed files with 13 additions and 1 deletions

View file

@ -343,7 +343,8 @@
ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto"
helpers:TextBoxHelper.Placeholder="Enter commit message" helpers:TextBoxHelper.Placeholder="Enter commit message"
helpers:TextBoxHelper.PlaceholderBaseline="Top"> helpers:TextBoxHelper.PlaceholderBaseline="Top"
PreviewMouseWheel="CommitMsgPreviewMouseWheel">
<TextBox.Text> <TextBox.Text>
<Binding ElementName="me" Path="CommitMessage" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged"> <Binding ElementName="me" Path="CommitMessage" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
<Binding.ValidationRules> <Binding.ValidationRules>

View file

@ -683,6 +683,17 @@ namespace SourceGit.UI {
#endregion #endregion
#region COMMIT_PANEL #region COMMIT_PANEL
private void CommitMsgPreviewMouseWheel(object sender, MouseWheelEventArgs e) {
var textBox = sender as TextBox;
if (textBox == null) return;
if (e.Delta > 0) {
textBox.LineUp();
} else {
textBox.LineDown();
}
}
private void OpenCommitMessageSelector(object sender, RoutedEventArgs e) { private void OpenCommitMessageSelector(object sender, RoutedEventArgs e) {
var anchor = sender as Button; var anchor = sender as Button;