From 5a53114d5a7e6ce8c8ddde6beea40e6ac2f0ab22 Mon Sep 17 00:00:00 2001 From: Ilya Glebov Date: Sat, 28 Feb 2026 19:25:52 +0100 Subject: [PATCH] Add double-click to play station --- internal/ui/stations.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/internal/ui/stations.go b/internal/ui/stations.go index e3573e3..a8ef67e 100644 --- a/internal/ui/stations.go +++ b/internal/ui/stations.go @@ -28,6 +28,20 @@ func (ui *UI) createStationListTable() *tview.Table { Foreground(ui.colors.background). Background(ui.colors.highlight)) + table.SetMouseCapture(func(action tview.MouseAction, event *tcell.EventMouse) (tview.MouseAction, *tcell.EventMouse) { + if event == nil || action != tview.MouseLeftDoubleClick { + return action, event + } + x, y := event.Position() + row, _ := table.CellAt(x, y) + if row <= 0 || row > ui.stationService.StationCount() { + return action, event + } + table.Select(row, 0) + ui.onStationSelected(row - 1) + return tview.MouseConsumed, nil + }) + table.SetCell(0, 0, tview.NewTableCell(" "). SetTextColor(ui.colors.stationListHeaderForeground). SetBackgroundColor(ui.colors.stationListHeaderBackground).