Skip to content

Commit 8c00f22

Browse files
committed
Bump versions and update image handling
- Updated assembly and package versions to 1.0.7 and 1.2.14. - Upgraded `Microsoft.CodeAnalysis.CSharp.Scripting` to 4.14.0. - Changed `filename` type in `RenameFileDialog.cs` to `nuint`. - Updated `Hexa.NET.ImGui`, `System.Numerics.Vectors`, and `System.Text.Json` packages. - Added `Microsoft.Bcl.Numerics` version 9.0.7. - Changed image parameter types in `ImageHelper.cs` to `ImTextureRef`. - Updated `WidgetIcon` struct in `WidgetStyle.cs` for consistency. - Modified `ImGuiManager.cs` for improved error handling. - Updated `Hexa.NET.ImPlot` and `Hexa.NET.ImGui.Backends` versions in `TestApp.csproj`.
1 parent ea86349 commit 8c00f22

File tree

10 files changed

+96
-28
lines changed

10 files changed

+96
-28
lines changed

.github/FUNDING.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: junameinhold
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12+
polar: # Replace with a single Polar username
13+
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
14+
thanks_dev: # Replace with a single thanks.dev username
15+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/workflows/push-nuget.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish NuGet Packages
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v4
18+
with:
19+
dotnet-version: '9.0.x'
20+
21+
- name: Restore dependencies
22+
run: |
23+
dotnet restore Hexa.NET.ImGui.Widgets/Hexa.NET.ImGui.Widgets.csproj
24+
dotnet restore Hexa.NET.ImGui.Widgets.Extras/Hexa.NET.ImGui.Widgets.Extras.csproj
25+
26+
- name: Build the project
27+
run: |
28+
dotnet build Hexa.NET.ImGui.Widgets/Hexa.NET.ImGui.Widgets.csproj --configuration Release
29+
dotnet build Hexa.NET.ImGui.Widgets.Extras/Hexa.NET.ImGui.Widgets.Extras.csproj --configuration Release
30+
31+
- name: Pack the project
32+
run: |
33+
dotnet pack Hexa.NET.ImGui.Widgets/Hexa.NET.ImGui.Widgets.csproj --configuration Release --output ./nupkgs
34+
dotnet pack Hexa.NET.ImGui.Widgets.Extras/Hexa.NET.ImGui.Widgets.Extras.csproj --configuration Release --output ./nupkgs
35+
36+
- name: Exclude unwanted packages
37+
run: |
38+
for package in ./nupkgs/*.nupkg; do
39+
package_name=$(basename "$package")
40+
if [[ ! $package_name == Hexa.NET* ]]; then
41+
echo "Removing $package_name as it does not start with Hexa.NET."
42+
rm -f "$package"
43+
fi
44+
done
45+
46+
- name: List packages
47+
run: ls ./nupkgs/
48+
49+
- name: Publish the package
50+
run: dotnet nuget push ./nupkgs/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

Hexa.NET.ImGui.Widgets.Extras/Hexa.NET.ImGui.Widgets.Extras.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<Nullable>enable</Nullable>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
88

9-
<AssemblyVersion>1.0.6</AssemblyVersion>
10-
<PackageVersion>1.0.6</PackageVersion>
9+
<AssemblyVersion>1.0.7</AssemblyVersion>
10+
<PackageVersion>1.0.7</PackageVersion>
1111
<Description>
1212
Hexa.NET.ImGui.Widgets is a comprehensive library of custom widgets for the ImGui graphical user interface library. This package includes a variety of pre-built widgets that enhance the functionality and usability of ImGui in your .NET applications. Each widget is designed to be easy to integrate, with consistent styling and behavior. This library is an extension of the Hexa.NET.ImGui wrapper, providing additional UI components for a seamless user experience.
1313
</Description>
@@ -39,7 +39,7 @@
3939

4040
<ItemGroup>
4141
<PackageReference Include="Hexa.NET.Math" Version="2.0.6" />
42-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.12.0" />
42+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.14.0" />
4343
</ItemGroup>
4444

4545
</Project>

Hexa.NET.ImGui.Widgets/Dialogs/RenameFileDialog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private void SetFlag(RenameDialogFlags flag, bool value)
104104

105105
protected override void DrawContent()
106106
{
107-
if (ImGui.InputText("New name", ref filename, (ulong)maxPathLength))
107+
if (ImGui.InputText("New name", ref filename, (nuint)maxPathLength))
108108
{
109109
destinationPath = Path.Combine(currentDirectory, filename);
110110
warnMessage = null;

Hexa.NET.ImGui.Widgets/Hexa.NET.ImGui.Widgets.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<EnableAotAnalyzer>true</EnableAotAnalyzer>
1313
<IsAotCompatible>true</IsAotCompatible>
1414

15-
<AssemblyVersion>1.2.13</AssemblyVersion>
16-
<PackageVersion>1.2.13</PackageVersion>
15+
<AssemblyVersion>1.2.14</AssemblyVersion>
16+
<PackageVersion>1.2.14</PackageVersion>
1717
<Description>
1818
Hexa.NET.ImGui.Widgets is a comprehensive library of custom widgets for the ImGui graphical user interface library. This package includes a variety of pre-built widgets that enhance the functionality and usability of ImGui in your .NET applications. Each widget is designed to be easy to integrate, with consistent styling and behavior. This library is an extension of the Hexa.NET.ImGui wrapper, providing additional UI components for a seamless user experience.
1919
</Description>
@@ -47,21 +47,21 @@
4747
</ItemGroup>
4848

4949
<ItemGroup>
50-
<PackageReference Include="Hexa.NET.ImGui" Version="2.2.7" />
50+
<PackageReference Include="Hexa.NET.ImGui" Version="2.2.8" />
5151
<PackageReference Include="Hexa.NET.Utilities" Version="2.2.2" />
5252
</ItemGroup>
5353

5454
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
5555
<PackageReference Include="Ultz.Bcl.Half" Version="1.0.0" />
56-
<PackageReference Include="System.Numerics.Vectors" Version="4.6.0" />
57-
<PackageReference Include="System.Text.Json" Version="9.0.3" />
56+
<PackageReference Include="System.Numerics.Vectors" Version="4.6.1" />
57+
<PackageReference Include="System.Text.Json" Version="9.0.7" />
5858
</ItemGroup>
5959

6060
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
6161
<PackageReference Include="Ultz.Bcl.Half" Version="1.0.0" />
62-
<PackageReference Include="System.Numerics.Vectors" Version="4.6.0" />
63-
<PackageReference Include="System.Text.Json" Version="9.0.3" />
64-
<PackageReference Include="Microsoft.Bcl.Numerics" Version="9.0.3" />
62+
<PackageReference Include="System.Numerics.Vectors" Version="4.6.1" />
63+
<PackageReference Include="System.Text.Json" Version="9.0.7" />
64+
<PackageReference Include="Microsoft.Bcl.Numerics" Version="9.0.7" />
6565
<PackageReference Include="Microsoft.Bcl.HashCode" Version="6.0.0" />
6666
<PackageReference Include="IndexRange" Version="1.0.3" />
6767
</ItemGroup>

Hexa.NET.ImGui.Widgets/ImGuiTreeNode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public static bool IconTreeNode(byte* label, byte* labelEnd, byte* icon, Vector4
130130
bool store_tree_node_stack_data = false;
131131
if ((flags & ImGuiTreeNodeFlags.NoTreePushOnOpen) == 0)
132132
{
133-
if ((flags & ImGuiTreeNodeFlags.NavLeftJumpsBackHere) != 0 && is_open && !g.NavIdIsAlive)
133+
if ((flags & ImGuiTreeNodeFlags.NavLeftJumpsToParent) != 0 && is_open && !g.NavIdIsAlive)
134134
if (g.NavMoveDir == ImGuiDir.Left && g.NavWindow == window && ImGuiP.NavMoveRequestButNoResultYet())
135135
store_tree_node_stack_data = true;
136136
}

Hexa.NET.ImGui.Widgets/ImageHelper.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static class ImageHelper
1313
/// </summary>
1414
/// <param name="image">The identifier of the image to display.</param>
1515
/// <param name="size">The size of the image.</param>
16-
public static void ImageCenteredV(ImTextureID image, Vector2 size)
16+
public static void ImageCenteredV(ImTextureRef image, Vector2 size)
1717
{
1818
var windowHeight = ImGui.GetWindowSize().Y;
1919
var imageHeight = size.Y;
@@ -27,7 +27,7 @@ public static void ImageCenteredV(ImTextureID image, Vector2 size)
2727
/// </summary>
2828
/// <param name="image">The identifier of the image to display.</param>
2929
/// <param name="size">The size of the image.</param>
30-
public static void ImageCenteredH(ImTextureID image, Vector2 size)
30+
public static void ImageCenteredH(ImTextureRef image, Vector2 size)
3131
{
3232
var windowWidth = ImGui.GetWindowSize().X;
3333
var imageWidth = size.X;
@@ -41,7 +41,7 @@ public static void ImageCenteredH(ImTextureID image, Vector2 size)
4141
/// </summary>
4242
/// <param name="image">The identifier of the image to display.</param>
4343
/// <param name="size">The size of the image.</param>
44-
public static void ImageCenteredVH(ImTextureID image, Vector2 size)
44+
public static void ImageCenteredVH(ImTextureRef image, Vector2 size)
4545
{
4646
var windowSize = ImGui.GetWindowSize();
4747

@@ -50,11 +50,12 @@ public static void ImageCenteredVH(ImTextureID image, Vector2 size)
5050
}
5151

5252
/// <summary>
53-
/// Displays an image centered both vertically and horizontally in the window with the specified size.
53+
/// Displays an image scaled to fit within the specified destination size, preserving aspect ratio.
5454
/// </summary>
5555
/// <param name="image">The identifier of the image to display.</param>
56-
/// <param name="size">The size of the image.</param>
57-
public static void ImageScaleTo(ImTextureID image, Vector2 imgSize, Vector2 destSize)
56+
/// <param name="imgSize">The original size of the image.</param>
57+
/// <param name="destSize">The maximum size to scale the image to fit within.</param>
58+
public static void ImageScaleTo(ImTextureRef image, Vector2 imgSize, Vector2 destSize)
5859
{
5960
Vector2 ratio = destSize / imgSize;
6061
var scale = Math.Min(ratio.X, ratio.Y);

Hexa.NET.ImGui.Widgets/WidgetStyle.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public unsafe struct WidgetIcon
3434
{
3535
public char IconText;
3636
public uint IconUTF8Bytes;
37-
public ImTextureID IconImage;
37+
public ImTextureRef IconImage;
3838
public IconType Type;
3939

4040
public WidgetIcon(char iconText)
@@ -43,11 +43,11 @@ public WidgetIcon(char iconText)
4343
uint utf8Bytes = 0;
4444
Utf8Formatter.ConvertUtf16ToUtf8(&iconText, 1, (byte*)&utf8Bytes, 4);
4545
IconUTF8Bytes = utf8Bytes;
46-
IconImage = 0;
46+
IconImage = new(null, new ImTextureID(0));
4747
Type = IconType.Text;
4848
}
4949

50-
public WidgetIcon(ImTextureID iconImage)
50+
public WidgetIcon(ImTextureRef iconImage)
5151
{
5252
IconText = '\0';
5353
IconUTF8Bytes = '\0';
@@ -61,11 +61,11 @@ public WidgetIcon(ImTextureID iconImage)
6161

6262
public static implicit operator WidgetIcon(char iconText) => new(iconText);
6363

64-
public static implicit operator WidgetIcon(ImTextureID iconImage) => new(iconImage);
64+
public static implicit operator WidgetIcon(ImTextureRef iconImage) => new(iconImage);
6565

6666
public static implicit operator char(WidgetIcon icon) => icon.IconText;
6767

68-
public static implicit operator ImTextureID(WidgetIcon icon) => icon.IconImage;
68+
public static implicit operator ImTextureRef(WidgetIcon icon) => icon.IconImage;
6969

7070
public readonly unsafe void Text()
7171
{

TestApp/ImGuiManager.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ public unsafe ImGuiManager(Hexa.NET.SDL2.SDLWindow* window, SDLGLContext context
4646
io.ConfigViewportsNoAutoMerge = false;
4747
io.ConfigViewportsNoTaskBarIcon = false;
4848
io.ConfigDebugIsDebuggerPresent = Debugger.IsAttached;
49-
io.ConfigErrorRecoveryEnableAssert = true;
49+
io.ConfigErrorRecoveryEnableAssert = false;
50+
io.ConfigErrorRecoveryEnableTooltip = true;
51+
io.ConfigErrorRecoveryEnableDebugLog = true;
5052

5153
// Setup Platform
5254
ImGuiImplSDL2.SetCurrentContext(guiContext);

TestApp/TestApp.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="Hexa.NET.ImPlot" Version="2.2.7" />
18+
<PackageReference Include="Hexa.NET.ImPlot" Version="2.2.8" />
1919
<PackageReference Include="Hexa.NET.OpenGL3" Version="1.1.0" />
2020
<PackageReference Include="Hexa.NET.SDL2" Version="1.2.14" />
21-
<PackageReference Include="Hexa.NET.ImGui.Backends" Version="1.0.15" />
22-
<PackageReference Include="Hexa.NET.ImGui.Backends.SDL2" Version="1.0.15" />
21+
<PackageReference Include="Hexa.NET.ImGui.Backends" Version="1.0.17" />
22+
<PackageReference Include="Hexa.NET.ImGui.Backends.SDL2" Version="1.0.17" />
2323
</ItemGroup>
2424

2525
<ItemGroup>

0 commit comments

Comments
 (0)