Gtk improvements
Squashed commit of the following: commit 724c487ff5feca1e5ed1e0f006dd1c8e0112954b Author: luxick <git@luxick.de> Date: Thu Mar 5 17:56:01 2020 +0100 Reorder player columns commit 5f56f73912122a42c3ee8fc64ed9760d18b9e706 Author: luxick <git@luxick.de> Date: Thu Mar 5 17:52:17 2020 +0100 Data column constructor fix commit fae314804b5bbe1be58ebdcb64690544bae76d1b Author: luxick <git@luxick.de> Date: Thu Mar 5 17:51:39 2020 +0100 Do not cast values in liststore to string
This commit is contained in:
@@ -84,7 +84,7 @@ namespace EstusShots.Gtk.Controls
|
||||
$"Property '{column.PropertyName}' does not exist on Type '{item.GetType()}'");
|
||||
var val = prop.GetValue(item);
|
||||
if (column.Format != null) val = column.Format(val);
|
||||
row.Add(val.ToString());
|
||||
row.Add(val);
|
||||
}
|
||||
|
||||
// The key value must be the first value in the row
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace EstusShots.Gtk.Controls
|
||||
Reorderable = true;
|
||||
}
|
||||
|
||||
public DataColumn(string propertyName)
|
||||
public DataColumn(string propertyName) : this()
|
||||
{
|
||||
PropertyName = propertyName;
|
||||
Title = propertyName;
|
||||
|
||||
@@ -28,8 +28,8 @@ namespace EstusShots.Gtk
|
||||
{
|
||||
new DataColumn(nameof(Player.Name)),
|
||||
new DataColumn(nameof(Player.Alias)),
|
||||
new DataColumn(nameof(Player.Anonymous)) {Title = "Is Anonymous?", FixedWidth = 120},
|
||||
new DataColumn(nameof(Player.HexId)) {Title = "Hex ID"},
|
||||
new DataColumn(nameof(Player.Anonymous)) {Title = "Is Anonymous?", FixedWidth = 30}
|
||||
};
|
||||
PlayersControl = new BindableListControl<Player>(columns, nameof(Player.PlayerId), PlayersTreeView);
|
||||
PlayersControl.OnSelectionChanged += PlayersControlOnOnSelectionChanged;
|
||||
|
||||
Reference in New Issue
Block a user