diff --git a/hamy-vpn-client-fixed.exe b/hamy-vpn-client-fixed.exe new file mode 100644 index 0000000..072bfac Binary files /dev/null and b/hamy-vpn-client-fixed.exe differ diff --git a/main.go b/main.go index 6dc16df..d590c71 100644 --- a/main.go +++ b/main.go @@ -264,15 +264,17 @@ func main() { ) }, func(id widget.ListItemID, obj fyne.CanvasObject) { - box := obj.(*fyne.Container) - titleLabel := box.Objects[1].(*widget.Label) - buttonsContainer := box.Objects[2].(*fyne.Container) + containerObj := obj.(*fyne.Container) + + // For a container.NewBorder(nil, nil, left, right, nil), the structure is: + // Objects[0] is the left element (label) + // Objects[1] is the right element (buttons container) + titleLabel := containerObj.Objects[0].(*widget.Label) + buttonsContainer := containerObj.Objects[1].(*fyne.Container) editButton := buttonsContainer.Objects[0].(*widget.Button) deleteButton := buttonsContainer.Objects[1].(*widget.Button) - titleLabel.SetText(configs[id].Title) - // Update visual indication for active config if id == activeConfig { titleLabel.SetText(fmt.Sprintf("● %s", configs[id].Title)) @@ -300,15 +302,6 @@ func main() { }, configWindow) } - - // Allow clicking on the whole row to select the config - selectButton := widget.NewButton("", func() { - activeConfig = id - dialog.ShowInformation("Config Selected", fmt.Sprintf("Active config: %s", configs[id].Title), configWindow) - configWindow.Close() - }) - selectButton.Hidden = true - box.Objects[0] = container.NewStack(selectButton) }, ) @@ -337,11 +330,8 @@ func main() { // Using container.NewBorder to make the entry expand properly importContainer := container.NewBorder(nil, nil, nil, importButton, importEntry) - // Main content for the config window - configContent := container.NewVBox( - importContainer, - scrollContainer, - ) + // Main content for the config window using a border container to properly size the scroll area + configContent := container.NewBorder(importContainer, nil, nil, nil, scrollContainer) configWindow.SetContent(configContent) configWindow.Show()