Доработка интерфейса (vibe-kanban 3c7ecd26)
на данный момент в проекте есть ошибки (я неправильно сделал merge и теперь проект с ошибками) - нужно их исправить, а также пофиксить баг в окне настроек - поле ввода ссылки очень сжатое в длину - нужно пофиксить. Обязательно проверь компиляцию
This commit is contained in:
BIN
hamy-vpn-client.exe
Normal file
BIN
hamy-vpn-client.exe
Normal file
Binary file not shown.
29
main.go
29
main.go
@@ -222,11 +222,16 @@ func main() {
|
||||
configWindow.Resize(fyne.NewSize(400, 300))
|
||||
configWindow.SetFixedSize(true)
|
||||
|
||||
// Declare variables before use
|
||||
var listContainer *widget.List
|
||||
var scrollContainer *container.Scroll
|
||||
var refreshList func()
|
||||
|
||||
// Entry for importing new configuration
|
||||
importEntry := widget.NewEntry()
|
||||
importEntry.PlaceHolder = "vless://..."
|
||||
|
||||
// Import button
|
||||
// Import button - define after all necessary variables
|
||||
importButton := widget.NewButtonWithIcon("", theme.ContentAddIcon(), func() {
|
||||
url := importEntry.Text
|
||||
if url != "" && isValidVLESS(url) {
|
||||
@@ -244,15 +249,9 @@ func main() {
|
||||
}
|
||||
})
|
||||
|
||||
// Container for import field and button
|
||||
importContainer := container.NewBorder(nil, nil, importEntry, importButton)
|
||||
|
||||
// Create a list of config titles for selection
|
||||
var listContainer *widget.List
|
||||
|
||||
refreshList := func() {
|
||||
refreshList = func() {
|
||||
// Need to recreate the list since we can't refresh it directly
|
||||
listContainer = widget.NewList(
|
||||
newListContainer := widget.NewList(
|
||||
func() int {
|
||||
return len(configs)
|
||||
},
|
||||
@@ -314,16 +313,24 @@ func main() {
|
||||
},
|
||||
)
|
||||
|
||||
listContainer.OnSelected = func(id widget.ListItemID) {
|
||||
newListContainer.OnSelected = func(id widget.ListItemID) {
|
||||
activeConfig = id
|
||||
dialog.ShowInformation("Config Selected", fmt.Sprintf("Active config: %s", configs[id].Title), configWindow)
|
||||
configWindow.Close()
|
||||
}
|
||||
|
||||
// Replace the list container content
|
||||
scrollContainer.Content = newListContainer
|
||||
scrollContainer.Refresh()
|
||||
listContainer = newListContainer
|
||||
}
|
||||
|
||||
refreshList()
|
||||
|
||||
scrollContainer := container.NewScroll(listContainer)
|
||||
scrollContainer = container.NewScroll(listContainer)
|
||||
|
||||
// Container for import field and button - use HBox to allow proper expansion
|
||||
importContainer := container.NewHBox(importEntry, importButton)
|
||||
|
||||
// Main content for the config window
|
||||
configContent := container.NewVBox(
|
||||
|
||||
Reference in New Issue
Block a user