Skip to content

Commit 7b191a0

Browse files
committed
CQ: Correct SideBar manipulation
1 parent c08abde commit 7b191a0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Files.App/Helpers/Application/AppLanguageHelper.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public static class AppLanguageHelper
3636

3737
public static CultureInfo PreferredCulture => new(PreferredLanguage.Code);
3838

39+
public static FlowDirection FlowDirection => PreferredCulture.TextInfo.IsRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;
40+
3941
/// <summary>
4042
/// Initializes the <see cref="AppLanguageHelper"/> class.
4143
/// </summary>
@@ -145,7 +147,7 @@ public static bool UpdateTitleBar(Window window)
145147
// TODO: Replaced by RealTime Resources in the future
146148
public static void UpdateContextLayout(FrameworkElement element)
147149
{
148-
element.FlowDirection = PreferredCulture.TextInfo.IsRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;
150+
element.FlowDirection = FlowDirection;
149151
}
150152

151153
// TODO: Replaced by RealTime Resources in the future

src/Files.App/UserControls/Sidebar/SidebarView.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ private void SidebarResizer_ManipulationStarted(object sender, ManipulationStart
130130

131131
private void SidebarResizer_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
132132
{
133-
var newWidth = preManipulationSidebarWidth + e.Cumulative.Translation.X;
133+
var rePos = AppLanguageHelper.FlowDirection == FlowDirection.LeftToRight ? 1 : -1;
134+
var newWidth = preManipulationSidebarWidth + (e.Cumulative.Translation.X * rePos);
134135
UpdateDisplayModeForPaneWidth(newWidth);
135136
e.Handled = true;
136137
}

0 commit comments

Comments
 (0)