Skip to content

Fix: Fixed icon not showing in stable and preview builds #11188

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 1 commit into from
Feb 6, 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
5 changes: 4 additions & 1 deletion src/Files.App/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ public partial class App : Application
public static SecondaryTileHelper SecondaryTileHelper { get; private set; } = new SecondaryTileHelper();

public static string AppVersion = $"{Package.Current.Id.Version.Major}.{Package.Current.Id.Version.Minor}.{Package.Current.Id.Version.Build}.{Package.Current.Id.Version.Revision}";

public static string LogoPath;

public IServiceProvider Services { get; private set; }

/// <summary>
Expand All @@ -93,6 +94,8 @@ public App()
InitializeComponent();
Services = ConfigureServices();
Ioc.Default.ConfigureServices(Services);
LogoPath = Package.Current.DisplayName == "Files - Dev" ? Constants.AssetPaths.DevLogo
: (Package.Current.DisplayName == "Files - Preview" ? Constants.AssetPaths.PreviewLogo : Constants.AssetPaths.StableLogo);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The display name for preview is Files (Preview)

}

private IServiceProvider ConfigureServices()
Expand Down
4 changes: 3 additions & 1 deletion src/Files.App/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ public static class WslIconsPaths

public static class AssetPaths
{
public const string Logo = "Assets/AppTiles/Dev/Logo.ico";
public const string DevLogo = "Assets/AppTiles/Dev/Logo.ico";
public const string PreviewLogo = "Assets/AppTiles/Preview/Logo.ico";
public const string StableLogo = "Assets/AppTiles/Release/Logo.ico";
}

public static class UI
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Helpers/FilePropertiesHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,6 @@ void Navigate(Frame frame)
}

private static string GetFilesLogoPath()
=> Path.Combine(Package.Current.InstalledLocation.Path, Constants.AssetPaths.Logo);
=> Path.Combine(Package.Current.InstalledLocation.Path, App.LogoPath);
}
}
4 changes: 2 additions & 2 deletions src/Files.App/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ private void EnsureEarlyWindow()
// Set title
AppWindow.Title = "Files";

// Set icon
AppWindow.SetIcon(Path.Combine(Package.Current.InstalledLocation.Path, Constants.AssetPaths.Logo));
// Set logo
AppWindow.SetIcon(Path.Combine(Package.Current.InstalledLocation.Path, App.LogoPath));

// Extend title bar
AppWindow.TitleBar.ExtendsContentIntoTitleBar = true;
Expand Down