Skip to content
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions QuickShell/QuickShell.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<Content Include="Assets\**\*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<!-- Partner Center store listing art is generated here but must not ship in the MSIX. -->
<Content Remove="Assets\StoreListing\**" />
</ItemGroup>

<Target Name="GenerateLogoAssets" BeforeTargets="PrepareForBuild"
Expand Down
Binary file modified cmdpal-gallery/extensions/tonythethompson/quickshell/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 18 additions & 10 deletions scripts/LogoAssetGenerator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@

if (args.Length >= 5 && args[0] == "--render")
{
var svgPath = Path.GetFullPath(args[1]);
var outPath = Path.GetFullPath(args[2]);
var width = int.Parse(args[3], System.Globalization.CultureInfo.InvariantCulture);
var height = int.Parse(args[4], System.Globalization.CultureInfo.InvariantCulture);
Directory.CreateDirectory(Path.GetDirectoryName(outPath)!);
RenderSvgToPng(svgPath, outPath, width, height);
return 0;
try
{
var svgPath = Path.GetFullPath(args[1]);
var outPath = Path.GetFullPath(args[2]);
var width = int.Parse(args[3], System.Globalization.CultureInfo.InvariantCulture);
var height = int.Parse(args[4], System.Globalization.CultureInfo.InvariantCulture);
Directory.CreateDirectory(Path.GetDirectoryName(outPath)!);
RenderSvgToPng(svgPath, outPath, width, height);
return 0;
}
catch (Exception ex)
{
Console.Error.WriteLine(ex.Message);
return 1;
}
}

if (args.Length < 2)
Expand Down Expand Up @@ -95,7 +103,7 @@ static void RenderSquareLogo(string outDir, string fileName, SKPicture picture,
var renderHeight = height * supersample;

var info = new SKImageInfo(renderWidth, renderHeight, SKColorType.Rgba8888, SKAlphaType.Premul);
using var surface = SKSurface.Create(info);
using var surface = SKSurface.Create(info) ?? throw new InvalidOperationException($"Failed to allocate surface {renderWidth}x{renderHeight} for {fileName}");
var canvas = surface.Canvas;
canvas.Clear(SKColors.Transparent);

Expand Down Expand Up @@ -539,7 +547,7 @@ static void RenderSvgToPng(string svgPath, string outPath, int width, int height
var renderHeight = height * supersample;

var info = new SKImageInfo(renderWidth, renderHeight, SKColorType.Rgba8888, SKAlphaType.Premul);
using var surface = SKSurface.Create(info);
using var surface = SKSurface.Create(info) ?? throw new InvalidOperationException($"Failed to allocate surface {renderWidth}x{renderHeight} for {Path.GetFileName(svgPath)}");
var canvas = surface.Canvas;
canvas.Clear(SKColors.Transparent);

Expand All @@ -566,7 +574,7 @@ static void WritePng(SKSurface surface, string outPath, int width, int height)
if (rendered.Width != width || rendered.Height != height)
{
var info = new SKImageInfo(width, height, SKColorType.Rgba8888, SKAlphaType.Premul);
using var destSurface = SKSurface.Create(info);
using var destSurface = SKSurface.Create(info) ?? throw new InvalidOperationException($"Failed to allocate resize surface {width}x{height} for {outPath}");
var canvas = destSurface.Canvas;
canvas.Clear(SKColors.Transparent);
using var paint = new SKPaint
Expand Down
12 changes: 11 additions & 1 deletion scripts/generate-assets.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ New-Item -ItemType Directory -Force -Path $runImagesDir | Out-Null



dotnet build $generatorProject | Out-Null
dotnet build $generatorProject --no-incremental | Out-Null
if ($LASTEXITCODE -ne 0) {
throw "LogoAssetGenerator build failed with exit code $LASTEXITCODE"
}
Expand Down Expand Up @@ -73,8 +73,18 @@ if ($LASTEXITCODE -ne 0) {



$cmdPalIcon = Join-Path $repoRoot 'cmdpal-gallery\extensions\tonythethompson\quickshell\icon.png'
$appTile300 = Join-Path $assetsDir 'StoreListing\AppTile_300x300.png'
if (-not (Test-Path $appTile300)) {
throw "Missing store listing icon source: $appTile300"
}

New-Item -ItemType Directory -Force -Path (Split-Path $cmdPalIcon -Parent) | Out-Null
Copy-Item -Force $appTile300 $cmdPalIcon

Write-Host "Quick Shell assets generated from logo-micro.svg:"
Write-Host " MSIX: $assetsDir"
Write-Host " Store listing (Partner Center): $(Join-Path $assetsDir 'StoreListing')"
Write-Host " Run: $runImagesDir"
Write-Host " CmdPal gallery: $cmdPalIcon"

Loading