фикс окна конфигураций (vibe-kanban 3fe07924)
в окне конфигураций есть баг с отображением списка конфигураций - этот скроллвью сжат по высоте (он приклеился к верху и отображается не во всё пространство окна).
This commit is contained in:
BIN
hamy-vpn-client-fixed.exe
Normal file
BIN
hamy-vpn-client-fixed.exe
Normal file
Binary file not shown.
28
main.go
28
main.go
@@ -264,15 +264,17 @@ func main() {
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
func(id widget.ListItemID, obj fyne.CanvasObject) {
|
func(id widget.ListItemID, obj fyne.CanvasObject) {
|
||||||
box := obj.(*fyne.Container)
|
containerObj := obj.(*fyne.Container)
|
||||||
titleLabel := box.Objects[1].(*widget.Label)
|
|
||||||
buttonsContainer := box.Objects[2].(*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)
|
editButton := buttonsContainer.Objects[0].(*widget.Button)
|
||||||
deleteButton := buttonsContainer.Objects[1].(*widget.Button)
|
deleteButton := buttonsContainer.Objects[1].(*widget.Button)
|
||||||
|
|
||||||
titleLabel.SetText(configs[id].Title)
|
|
||||||
|
|
||||||
// Update visual indication for active config
|
// Update visual indication for active config
|
||||||
if id == activeConfig {
|
if id == activeConfig {
|
||||||
titleLabel.SetText(fmt.Sprintf("● %s", configs[id].Title))
|
titleLabel.SetText(fmt.Sprintf("● %s", configs[id].Title))
|
||||||
@@ -300,15 +302,6 @@ func main() {
|
|||||||
},
|
},
|
||||||
configWindow)
|
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
|
// Using container.NewBorder to make the entry expand properly
|
||||||
importContainer := container.NewBorder(nil, nil, nil, importButton, importEntry)
|
importContainer := container.NewBorder(nil, nil, nil, importButton, importEntry)
|
||||||
|
|
||||||
// Main content for the config window
|
// Main content for the config window using a border container to properly size the scroll area
|
||||||
configContent := container.NewVBox(
|
configContent := container.NewBorder(importContainer, nil, nil, nil, scrollContainer)
|
||||||
importContainer,
|
|
||||||
scrollContainer,
|
|
||||||
)
|
|
||||||
|
|
||||||
configWindow.SetContent(configContent)
|
configWindow.SetContent(configContent)
|
||||||
configWindow.Show()
|
configWindow.Show()
|
||||||
|
|||||||
Reference in New Issue
Block a user