From 6251a4f2350fe0263fface05f21af9ddf0ff6c87 Mon Sep 17 00:00:00 2001 From: luxick Date: Sat, 29 Feb 2020 22:37:58 +0100 Subject: [PATCH] Select season with double click --- EstusShots.Gtk/Controls/BindableListControl.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/EstusShots.Gtk/Controls/BindableListControl.cs b/EstusShots.Gtk/Controls/BindableListControl.cs index 53643ac..19e26a8 100644 --- a/EstusShots.Gtk/Controls/BindableListControl.cs +++ b/EstusShots.Gtk/Controls/BindableListControl.cs @@ -37,7 +37,7 @@ namespace EstusShots.Gtk.Controls TreeView.Model = ListStore; Items = new List(); - TreeView.Selection.Changed += TreeView_SelectionChanged; + TreeView.RowActivated += TreeViewOnRowActivated; } /// The GTK ListStore that is managed by this . @@ -99,10 +99,11 @@ namespace EstusShots.Gtk.Controls Console.WriteLine(e); } } - - private void TreeView_SelectionChanged(object sender, EventArgs e) + + private void TreeViewOnRowActivated(object o, RowActivatedArgs args) { - if (!(sender is TreeSelection selection)) return; + if (!(o is TreeView tree)) return; + var selection = tree.Selection; selection.GetSelected(out var model, out var iter); var key = model.GetValue(iter, 0); var item = Items.FirstOrDefault(x =>