Focus 1st pinned item or 1st found app icon

This commit is contained in:
Piotr Miller
2021-06-17 13:24:03 +02:00
parent 48bc9f47b3
commit b0852f7680

View File

@@ -311,6 +311,15 @@ func main() {
resultsWrapper.PackStart(appSearchResultWrapper, false, false, 0) resultsWrapper.PackStart(appSearchResultWrapper, false, false, 0)
appFlowBox = setUpAppsFlowBox(nil, "") appFlowBox = setUpAppsFlowBox(nil, "")
// Focus 1st pinned item if any, otherwise focus 1st found app icon
var button gtk.IWidget
if pinnedFlowBox.GetChildren().Length() > 0 {
button, _ = pinnedFlowBox.GetChildAtIndex(0).GetChild()
} else {
button, _ = appFlowBox.GetChildAtIndex(0).GetChild()
}
button.ToWidget().GrabFocus()
userDirsMap = mapXdgUserDirs() userDirsMap = mapXdgUserDirs()
placeholder, _ := gtk.BoxNew(gtk.ORIENTATION_VERTICAL, 0) placeholder, _ := gtk.BoxNew(gtk.ORIENTATION_VERTICAL, 0)