mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-22 20:37:19 -08:00
fix: add ScrollViewer event handler to disable scroll indicators based on scroll position
This commit is contained in:
parent
e5516b5b9f
commit
0fcef2343a
2 changed files with 11 additions and 1 deletions
|
@ -96,7 +96,8 @@
|
|||
VerticalScrollBarVisibility="Disabled"
|
||||
DoubleTapped="MaximizeOrRestoreWindow"
|
||||
PointerPressed="BeginMoveWindow"
|
||||
PointerWheelChanged="ScrollTabs">
|
||||
PointerWheelChanged="ScrollTabs"
|
||||
ScrollChanged="OnTabsScrollChanged">
|
||||
<StackPanel x:Name="launcherTabsBar" Orientation="Horizontal" SizeChanged="UpdateScrollIndicator">
|
||||
<ListBox Classes="launcher_page_tabbar"
|
||||
ItemsSource="{Binding Pages}"
|
||||
|
|
|
@ -265,6 +265,15 @@ namespace SourceGit.Views
|
|||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnTabsScrollChanged(object sender, ScrollChangedEventArgs e)
|
||||
{
|
||||
if (sender is ScrollViewer scrollViewer)
|
||||
{
|
||||
leftScrollIndicator.IsEnabled = scrollViewer.Offset.X > 0;
|
||||
rightScrollIndicator.IsEnabled = scrollViewer.Offset.X < scrollViewer.Extent.Width - scrollViewer.Viewport.Width;
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupDragAndDrop(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Border border)
|
||||
|
|
Loading…
Reference in a new issue