From e5516b5b9f8608517f0a51630a6c882abb550070 Mon Sep 17 00:00:00 2001 From: Gadfly Date: Sat, 11 May 2024 21:51:57 +0800 Subject: [PATCH 1/3] fix: Fixed ScrollViewer rebounding when scrolling to the right --- src/Views/Launcher.axaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Views/Launcher.axaml.cs b/src/Views/Launcher.axaml.cs index 308cf0b6..8d5a38b8 100644 --- a/src/Views/Launcher.axaml.cs +++ b/src/Views/Launcher.axaml.cs @@ -232,7 +232,7 @@ namespace SourceGit.Views { if (e.Delta.Y < 0) launcherTabsScroller.LineRight(); - else + else if (e.Delta.Y > 0) launcherTabsScroller.LineLeft(); e.Handled = true; } From 0fcef2343a38db4db004fb7cb8c0969de3c45939 Mon Sep 17 00:00:00 2001 From: Gadfly Date: Sat, 11 May 2024 21:59:37 +0800 Subject: [PATCH 2/3] fix: add ScrollViewer event handler to disable scroll indicators based on scroll position --- src/Views/Launcher.axaml | 3 ++- src/Views/Launcher.axaml.cs | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Views/Launcher.axaml b/src/Views/Launcher.axaml index f5166de2..9166f095 100644 --- a/src/Views/Launcher.axaml +++ b/src/Views/Launcher.axaml @@ -96,7 +96,8 @@ VerticalScrollBarVisibility="Disabled" DoubleTapped="MaximizeOrRestoreWindow" PointerPressed="BeginMoveWindow" - PointerWheelChanged="ScrollTabs"> + PointerWheelChanged="ScrollTabs" + ScrollChanged="OnTabsScrollChanged"> 0; + rightScrollIndicator.IsEnabled = scrollViewer.Offset.X < scrollViewer.Extent.Width - scrollViewer.Viewport.Width; + } + } + private void SetupDragAndDrop(object sender, RoutedEventArgs e) { if (sender is Border border) From ed680bf8130655d4c29dcd0f0dc19d2d73a4a834 Mon Sep 17 00:00:00 2001 From: Gadfly Date: Sat, 11 May 2024 22:50:49 +0800 Subject: [PATCH 3/3] ux: Use RepeatButton instead of Button to make ScrollIndicator support PointerPress operation --- src/Resources/Styles.axaml | 6 +++--- src/Views/Launcher.axaml | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Resources/Styles.axaml b/src/Resources/Styles.axaml index 866fc987..afac434c 100644 --- a/src/Resources/Styles.axaml +++ b/src/Resources/Styles.axaml @@ -230,16 +230,16 @@ - - - diff --git a/src/Views/Launcher.axaml b/src/Views/Launcher.axaml index 9166f095..957777ae 100644 --- a/src/Views/Launcher.axaml +++ b/src/Views/Launcher.axaml @@ -86,9 +86,9 @@ - + - +