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

Feature: Added proper support for RTL languages #16514

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ba3d280
CQ: Add Win32 methods
XTorLukas Nov 23, 2024
bfc8002
CQ: Create SourceGenerator
XTorLukas Nov 23, 2024
52daef5
Feature: Implemented service `RealTimeLayoutService`
XTorLukas Nov 23, 2024
85b8f95
CQ: Change visibility
XTorLukas Nov 24, 2024
e7668e4
CQ: Correct change CurrentCulture
XTorLukas Nov 24, 2024
ae06d2d
CQ: Fix DragRegions
XTorLukas Nov 24, 2024
88b8f21
Fix: Use guid in the name
XTorLukas Nov 24, 2024
e61ee02
Feature: Add all Dialogs to RealRimeLayout
XTorLukas Nov 24, 2024
46cff34
CQ: Add FilePropertiesPage
XTorLukas Nov 24, 2024
37c35e2
CQ: Fix
XTorLukas Nov 24, 2024
4f551c1
CQ: Add comments
XTorLukas Nov 24, 2024
d515296
CQ: Add licence header
XTorLukas Nov 24, 2024
16e8842
CQ: Redesign the code
XTorLukas Nov 26, 2024
58c9adb
CQ: Fix
XTorLukas Nov 26, 2024
0344538
CQ: Add interface for class
XTorLukas Nov 26, 2024
8d5e95f
Fix: Solve problem with null reference
XTorLukas Nov 26, 2024
28e8805
CQ: Updates
XTorLukas Nov 26, 2024
67d6e34
Merge branch 'main' into xtorlukas/Featue-RealTimeLayoutUpdate
XTorLukas Nov 26, 2024
dde4c74
CQ: Removal of unnecessary parts
XTorLukas Nov 26, 2024
d8c717c
CQ: Set static FlowDirection
XTorLukas Nov 26, 2024
580e4f5
CQ: Update
XTorLukas Nov 26, 2024
a0cb941
CQ: Only one create field
XTorLukas Nov 26, 2024
77b7aa2
CQ: Add comments
XTorLukas Nov 26, 2024
2e56817
Fix: Arrows in RTL/LTR not visibility correctly
XTorLukas Nov 26, 2024
37e34a9
CQ: Add for Animated Icon
XTorLukas Nov 27, 2024
d591ae3
CQ: Correction
XTorLukas Nov 27, 2024
2a3eac4
CQ: Add gap
XTorLukas Nov 27, 2024
7f7e660
CQ: Turn off RealTime feature
XTorLukas Nov 29, 2024
31440a4
Revert: Gap changes
XTorLukas Dec 1, 2024
596c16e
Merge branch 'xtorlukas/Featue-RealTimeLayoutUpdate' into xtorlukas/F…
XTorLukas Dec 1, 2024
ca698e2
CQ: Add Forward & Back arrow correctly
XTorLukas Dec 1, 2024
38e6465
CQ: Add `FlowDirectionChanged` event
XTorLukas Dec 1, 2024
d7b8474
Merge branch 'xtorlukas/Fix-WrongArrowInRTL' into xtorlukas/Featue-Re…
XTorLukas Dec 1, 2024
702f84b
CQ: Fix Forward & Back buttons for RTL
XTorLukas Dec 1, 2024
0bd2cd5
Fix
XTorLukas Dec 1, 2024
05b3046
CQ: Fix `MainPropertiesPage` drag area for RTL
XTorLukas Dec 2, 2024
004be1b
CQ: ProgressRing fix in RTL
XTorLukas Dec 2, 2024
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
Prev Previous commit
Next Next commit
CQ: Add FlowDirectionChanged event
  • Loading branch information
XTorLukas committed Dec 1, 2024
commit 38e646565fca071a338e34c0ce0e468ef5455f8e
5 changes: 5 additions & 0 deletions src/Files.App/Data/Contracts/IRealTimeLayoutService.cs
Original file line number Diff line number Diff line change
@@ -11,6 +11,11 @@ namespace Files.App.Data.Contracts
/// </summary>
public interface IRealTimeLayoutService
{
/// <summary>
/// Occurs when the flow direction of the layout changes.
/// </summary>
public event EventHandler<FlowDirection>? FlowDirectionChanged;

/// <summary>
/// Gets the current flow direction for layout (e.g., LeftToRight or RightToLeft).
/// </summary>
5 changes: 5 additions & 0 deletions src/Files.App/Services/Content/RealTimeLayoutService.cs
Original file line number Diff line number Diff line change
@@ -21,6 +21,9 @@ internal sealed class RealTimeLayoutService : IRealTimeLayoutService
/// </summary>
private readonly List<(WeakReference<object> Reference, Action Callback)> _callbacks = [];

/// <inheritdoc/>
public event EventHandler<FlowDirection>? FlowDirectionChanged;

/// <inheritdoc/>
public FlowDirection FlowDirection => CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;

@@ -122,6 +125,8 @@ private void InvokeCallbacks()
item.Reference.TryGetTarget(out var targetObject) && targetObject != null)
.Select(item => item.Callback).ForEach(callback => callback());
_callbacks.RemoveAll(item => !item.Reference.TryGetTarget(out _));

FlowDirectionChanged?.Invoke(this, FlowDirection);
}
}
}