Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: pointer wheel scroll on seekbar to seek #365

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Screenbox/Controls/SeekBar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
Maximum="{x:Bind ViewModel.Length, Mode=OneWay, FallbackValue=0}"
Minimum="0"
PointerExited="SeekBarSlider_OnPointerExited"
PointerWheelChanged="SeekBarSlider_OnPointerWheelChanged"
SizeChanged="SeekBarSlider_OnSizeChanged"
SmallChange="5000"
Style="{StaticResource DefaultSliderStyle}"
Expand Down
7 changes: 7 additions & 0 deletions Screenbox/Controls/SeekBar.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ private void SeekBarThumb_PointerEntered(object sender, PointerRoutedEventArgs e
ViewModel.ShouldShowPreview = false;
}

private void SeekBarSlider_OnPointerWheelChanged(object sender, PointerRoutedEventArgs e)
{
PointerPoint? pointer = e.GetCurrentPoint((UIElement)sender);
int mouseWheelDelta = pointer.Properties.MouseWheelDelta;
SeekBarSlider.Value += mouseWheelDelta > 0 ? 10000 : -10000;
}

private void ResetPreviewToolTip()
{
_previewToolTipTimer.Stop();
Expand Down
Loading