Skip to content

Commit ae3f755

Browse files
committed
Fixed center handling
1 parent 29fdbb5 commit ae3f755

File tree

8 files changed

+16
-13
lines changed

8 files changed

+16
-13
lines changed

Changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 0.4.1
2+
3+
## ElectronNET.Core
4+
5+
- Fixed handling of `Center` property for windows (#1001)
6+
17
# 0.4.0
28

39
## ElectronNET.Core

docs/GettingStarted/Console-App.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Add the Electron.NET configuration to your `.csproj` file:
5454
</PropertyGroup>
5555

5656
<ItemGroup>
57-
<PackageReference Include="ElectronNET.Core" Version="0.4.0" />
57+
<PackageReference Include="ElectronNET.Core" Version="0.4.1" />
5858
</ItemGroup>
5959
```
6060

src/ElectronNET.API/API/Entities/BrowserWindowOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ public class BrowserWindowOptions
2424
/// ( if y is used) Window's left offset from screen. Default is to center the
2525
/// window.
2626
/// </summary>
27-
public int X { get; set; } = -1;
27+
public int? X { get; set; }
2828

2929
/// <summary>
3030
/// ( if x is used) Window's top offset from screen. Default is to center the
3131
/// window.
3232
/// </summary>
33-
public int Y { get; set; } = -1;
33+
public int? Y { get; set; }
3434

3535
/// <summary>
3636
/// The width and height would be used as web page's size, which means the actual

src/ElectronNET.API/API/WindowManager.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,8 @@ public async Task<BrowserWindow> CreateWindowAsync(BrowserWindowOptions options,
130130
options.Height += 7;
131131
}
132132

133-
if (options.X == -1 && options.Y == -1)
133+
if (!options.X.HasValue && !options.Y.HasValue)
134134
{
135-
options.X = 0;
136-
options.Y = 0;
137-
138135
await BridgeConnector.Socket.Emit("createBrowserWindow", options, loadUrl).ConfigureAwait(false);
139136
}
140137
else

src/ElectronNET.ConsoleApp/ElectronNET.ConsoleApp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<ProjectReference Include="..\ElectronNET.API\ElectronNET.API.csproj" Condition="$(ElectronNetDevMode)" />
7171
</ItemGroup>
7272
<ItemGroup>
73-
<PackageReference Include="ElectronNET.Core" Version="0.4.0" Condition="'$(ElectronNetDevMode)' != 'true'" />
73+
<PackageReference Include="ElectronNET.Core" Version="0.4.1" Condition="'$(ElectronNetDevMode)' != 'true'" />
7474
</ItemGroup>
7575

7676
<Import Project="..\ElectronNET\build\ElectronNET.Core.targets" Condition="$(ElectronNetDevMode)" />

src/ElectronNET.Samples.ElectronHostHook/ElectronNET.Samples.ElectronHostHook.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
</ItemGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="ElectronNET.Core" Version="0.2.0" Condition="'$(ElectronNetDevMode)' != 'true'" />
31-
<PackageReference Include="ElectronNET.Core.AspNet" Version="0.2.0" Condition="'$(ElectronNetDevMode)' != 'true'" />
30+
<PackageReference Include="ElectronNET.Core" Version="0.4.1" Condition="'$(ElectronNetDevMode)' != 'true'" />
31+
<PackageReference Include="ElectronNET.Core.AspNet" Version="0.4.1" Condition="'$(ElectronNetDevMode)' != 'true'" />
3232
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="5.9.3" />
3333
</ItemGroup>
3434

src/ElectronNET.WebApp/ElectronNET.WebApp.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@
7676
<ProjectReference Include="..\ElectronNET.AspNet\ElectronNET.AspNet.csproj" Condition="$(ElectronNetDevMode)" />
7777
</ItemGroup>
7878
<ItemGroup>
79-
<PackageReference Include="ElectronNET.Core" Version="0.4.0" Condition="'$(ElectronNetDevMode)' != 'true'" />
80-
<PackageReference Include="ElectronNET.Core.AspNet" Version="0.4.0" Condition="'$(ElectronNetDevMode)' != 'true'" />
79+
<PackageReference Include="ElectronNET.Core" Version="0.4.1" Condition="'$(ElectronNetDevMode)' != 'true'" />
80+
<PackageReference Include="ElectronNET.Core.AspNet" Version="0.4.1" Condition="'$(ElectronNetDevMode)' != 'true'" />
8181
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="5.9.3" />
8282
</ItemGroup>
8383

src/common.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>0.4.0</Version>
3+
<Version>0.4.1</Version>
44
<PackageNamePrefix>ElectronNET.Core</PackageNamePrefix>
55
<Authors>Gregor Biswanger, Florian Rappl, softworkz</Authors>
66
<Product>Electron.NET</Product>

0 commit comments

Comments
 (0)