Skip to content

Commit 75809e2

Browse files
committed
V2026.3.1 (GNOME)
1 parent eaa2551 commit 75809e2

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

Nickvision.Desktop.GNOME/Helpers/HostApplicationBuilderExtensions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ public IHostApplicationBuilder ConfigureAdw<T>(bool handlesOpen = false, bool in
2424
{
2525
throw new InvalidOperationException("AppInfo must be configured before calling ConfigureAdw.");
2626
}
27+
if (OperatingSystem.IsMacOS())
28+
{
29+
context.ResourceBasePath = $"/{appInfo.Id.Replace('.', '/')}";
30+
}
2731
builder.Services.AddSingleton(context);
2832
builder.Services.AddSingleton<IUserInterfaceContext<Adw.Application>>(context);
2933
builder.Services.AddSingleton<IUserInterfaceThread, AdwUserInterfaceThread>();

Nickvision.Desktop.GNOME/Hosting/AdwUserInterfaceContext.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ public class AdwUserInterfaceContext : IUserInterfaceContext<Adw.Application>
77
public Adw.Application? Application { get; set; }
88
public bool IsRunning { get; set; }
99
public bool HandlesOpen { get; set; }
10+
public string ResourceBasePath { get; set; }
1011

1112
public AdwUserInterfaceContext(bool handlesOpen)
1213
{
1314
Application = null;
1415
IsRunning = false;
1516
HandlesOpen = handlesOpen;
17+
ResourceBasePath = string.Empty;
1618
}
1719
}

Nickvision.Desktop.GNOME/Hosting/AdwUserInterfaceThread.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,18 @@ private void InitializeApplication()
9898
{
9999
var argumentsService = _serviceProvider.GetRequiredService<IArgumentsService>();
100100
_context.Application = _serviceProvider.GetRequiredService<Adw.Application>();
101-
_context.Application.OnStartup += (_, _) => _context.Application.AddWindow(_serviceProvider.GetRequiredService<Adw.ApplicationWindow>());
101+
_context.Application.OnStartup += (_, _) =>
102+
{
103+
if (!string.IsNullOrEmpty(_context.ResourceBasePath))
104+
{
105+
var display = Gdk.Display.GetDefault();
106+
if (display is not null)
107+
{
108+
Gtk.IconTheme.GetForDisplay(display).AddResourcePath(_context.ResourceBasePath);
109+
}
110+
}
111+
_context.Application.AddWindow(_serviceProvider.GetRequiredService<Adw.ApplicationWindow>());
112+
};
102113
_context.Application.OnShutdown += (_, _) =>
103114
{
104115
_context.IsRunning = false;

Nickvision.Desktop.GNOME/Nickvision.Desktop.GNOME.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
99
<EnableWindowsTargeting>true</EnableWindowsTargeting>
1010
<PackageId>Nickvision.Desktop.GNOME</PackageId>
11-
<Version>2026.3.0</Version>
11+
<Version>2026.3.1</Version>
1212
<Company>Nickvision</Company>
1313
<Authors>Nickvision</Authors>
1414
<Description>A set of controls and helpers for GNOME based Nickvision apps.</Description>
@@ -24,7 +24,7 @@
2424

2525
<ItemGroup>
2626
<PackageReference Include="GirCore.Adw-1" Version="0.7.0" />
27-
<PackageReference Include="Nickvision.Desktop" Version="2026.3.1" />
27+
<PackageReference Include="Nickvision.Desktop" Version="2026.3.2" />
2828
</ItemGroup>
2929

3030
<ItemGroup>

0 commit comments

Comments
 (0)