Skip to content

Startup speed improvements #12260

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

Merged
merged 3 commits into from
May 2, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
<PublishReadyToRunComposite Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRunComposite>
<!--
See https://github.com/microsoft/CsWinRT/issues/373
<PublishTrimmed>True</PublishTrimmed>
Expand Down
1 change: 1 addition & 0 deletions src/Files.App/Properties/PublishProfiles/win10-x64.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
<PublishReadyToRunComposite Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRunComposite>
<!--
See https://github.com/microsoft/CsWinRT/issues/373
<PublishTrimmed>True</PublishTrimmed>
Expand Down
1 change: 1 addition & 0 deletions src/Files.App/Properties/PublishProfiles/win10-x86.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
<PublishReadyToRunComposite Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRunComposite>
<!--
See https://github.com/microsoft/CsWinRT/issues/373
<PublishTrimmed>True</PublishTrimmed>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ public HorizontalMultitaskingControl()
tabHoverTimer.Interval = TimeSpan.FromMilliseconds(500);
tabHoverTimer.Tick += TabHoverSelected;

var flowDirectionSetting = new Microsoft.Windows.ApplicationModel.Resources.ResourceManager().CreateResourceContext().QualifierValues["LayoutDirection"];

var appWindowTitleBar = App.GetAppWindow(App.Window).TitleBar;
double rightPaddingColumnWidth = flowDirectionSetting is "RTL" ? appWindowTitleBar.LeftInset : appWindowTitleBar.RightInset;
double rightPaddingColumnWidth = FilePropertiesHelpers.FlowDirectionSettingIsRightToLeft ? appWindowTitleBar.LeftInset : appWindowTitleBar.RightInset;
RightPaddingColumn.Width = new GridLength(rightPaddingColumnWidth >= 0 ? rightPaddingColumnWidth : 0);
}

Expand Down
8 changes: 1 addition & 7 deletions src/Files.App/Views/BaseShellPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,7 @@ public BaseShellPage(CurrentInstanceViewModel instanceViewModel)

DisplayFilesystemConsentDialog();

// TODO:
// ResourceContext.GetForCurrentView and ResourceContext.GetForViewIndependentUse do not exist in Windows App SDK
// Use your ResourceManager instance to create a ResourceContext as below.If you already have a ResourceManager instance,
// replace the new instance created below with correct instance.
// Read: https://docs.microsoft.com/en-us/windows/apps/windows-app-sdk/migrate-to-windows-app-sdk/guides/mrtcore
var flowDirectionSetting = new Microsoft.Windows.ApplicationModel.Resources.ResourceManager().CreateResourceContext().QualifierValues["LayoutDirection"];
if (flowDirectionSetting == "RTL")
if (FilePropertiesHelpers.FlowDirectionSettingIsRightToLeft)
FlowDirection = FlowDirection.RightToLeft;

ToolbarViewModel.ToolbarPathItemInvoked += ShellPage_NavigationRequested;
Expand Down
3 changes: 1 addition & 2 deletions src/Files.App/Views/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ public MainPage()
ViewModel = Ioc.Default.GetRequiredService<MainPageViewModel>();
OngoingTasksViewModel = Ioc.Default.GetRequiredService<OngoingTasksViewModel>();

var flowDirectionSetting = new ResourceManager().CreateResourceContext().QualifierValues["LayoutDirection"];
if (flowDirectionSetting == "RTL")
if (FilePropertiesHelpers.FlowDirectionSettingIsRightToLeft)
FlowDirection = FlowDirection.RightToLeft;

UserSettingsService.OnSettingChangedEvent += UserSettingsService_OnSettingChangedEvent;
Expand Down