Skip to content

Commit e9d0d1e

Browse files
committed
V2025.12.1-gnome
1 parent 2879c0c commit e9d0d1e

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

Nickvision.Desktop.GNOME/Helpers/ComboRowExtensions.cs

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,40 @@
1-
using System.Collections.Generic;
1+
using Nickvision.Desktop.Application;
2+
using System.Collections.Generic;
23

34
namespace Nickvision.Desktop.GNOME.Helpers;
45

56
public static class ComboRowExtensions
67
{
78
extension(Adw.ComboRow row)
89
{
9-
public void SetModel(List<string> strs, string selected, bool allowElipse = true)
10+
public void SetModel(IReadOnlyList<ISelectionItem> selectionItems, bool allowElipse = true)
11+
{
12+
var selectedIndex = 0u;
13+
var list = Gtk.StringList.New(null);
14+
for(var i = 0; i < selectionItems.Count; i++)
15+
{
16+
var item = selectionItems[i];
17+
list.Append(item.Label);
18+
if(item.ShouldSelect)
19+
{
20+
selectedIndex = (uint)i;
21+
}
22+
}
23+
if (!allowElipse)
24+
{
25+
(row.Factory! as Gtk.SignalListItemFactory)!.OnSetup += (sender, args) =>
26+
{
27+
var box = (args.Object as Gtk.ListItem)!.Child;
28+
var label = box!.GetFirstChild() as Gtk.Label;
29+
label!.Ellipsize = Pango.EllipsizeMode.None;
30+
};
31+
}
32+
row.Model = list;
33+
list.Unref();
34+
row.Selected = selectedIndex;
35+
}
36+
37+
public void SetModel(IReadOnlyList<string> strs, string selected, bool allowElipse = true)
1038
{
1139
var selectedIndex = 0u;
1240
var list = Gtk.StringList.New(null);
@@ -33,7 +61,7 @@ public void SetModel(List<string> strs, string selected, bool allowElipse = true
3361
row.Selected = selectedIndex;
3462
}
3563

36-
public void SetModel(List<string> strs, uint selected, bool allowElipse = true)
64+
public void SetModel(IReadOnlyList<string> strs, uint selected, bool allowElipse = true)
3765
{
3866
var list = Gtk.StringList.New(null);
3967
foreach (var str in strs)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Nullable>enable</Nullable>
88
<EnableWindowsTargeting>true</EnableWindowsTargeting>
99
<PackageId>Nickvision.Desktop.GNOME</PackageId>
10-
<Version>2025.12.0</Version>
10+
<Version>2025.12.1</Version>
1111
<Company>Nickvision</Company>
1212
<Authors>Nickvision</Authors>
1313
<Description>A set of controls and helpers for GNOME based Nickvision apps.</Description>
@@ -23,7 +23,7 @@
2323

2424
<ItemGroup>
2525
<PackageReference Include="GirCore.Adw-1" Version="0.7.0" />
26-
<PackageReference Include="Nickvision.Desktop" Version="2025.12.0" />
26+
<PackageReference Include="Nickvision.Desktop" Version="2025.12.3" />
2727
</ItemGroup>
2828

2929
<ItemGroup>

0 commit comments

Comments
 (0)