From f8114f57a513fc261c4e11ae3bc617dc823a33fe Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 15 Apr 2024 09:09:42 +0300 Subject: [PATCH] open history page on double click --- src/Entity/Tab/History.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Entity/Tab/History.php b/src/Entity/Tab/History.php index ef8f9c4b..132a9758 100644 --- a/src/Entity/Tab/History.php +++ b/src/Entity/Tab/History.php @@ -197,9 +197,11 @@ class History $this->list ); + /* @TODO row-activated $this->treeview->get_selection()->set_mode( \GtkSelectionMode::MULTIPLE ); + */ // Compose body $this->body = new \GtkBox( @@ -245,9 +247,20 @@ class History // Activate events $this->treeview->connect( 'row-activated', - function () + function ($tree) { - // @TODO + list($list, $row) = $tree->get_selection() + ->get_selected(); + + $url = $list->get_value( + $row, 2 + ); + + $page = $this->app->blankPage(); + + $page->open( + $url + ); } ); }