focus 1st pinned if any, or focus 1st appBox entry; fixes #72

This commit is contained in:
piotr
2022-10-30 22:53:06 +01:00
parent f68678f687
commit 6494557979

10
main.go
View File

@@ -549,14 +549,16 @@ func main() {
fileSearchResultWrapper.Hide() fileSearchResultWrapper.Hide()
} }
// focus 1st element // focus 1st element
b := appFlowBox.GetChildAtIndex(0) var button gtk.IWidget
if b != nil { if pinnedFlowBox.GetChildren().Length() > 0 {
button, err := b.GetChild() button, err = pinnedFlowBox.GetChildAtIndex(0).GetChild()
} else {
button, err = appFlowBox.GetChildAtIndex(0).GetChild()
}
if err == nil { if err == nil {
button.ToWidget().GrabFocus() button.ToWidget().GrabFocus()
} }
} }
}
return false return false
}) })