hide empty file search result wrapper box

This commit is contained in:
piotr 2021-05-30 22:44:38 +02:00
parent 81350bf746
commit ba2ff5345b
3 changed files with 3 additions and 5 deletions

Binary file not shown.

View File

@ -19,7 +19,7 @@ import (
"github.com/gotk3/gotk3/gtk" "github.com/gotk3/gotk3/gtk"
) )
const version = "0.0.1" const version = "0.0.2"
var ( var (
appDirs []string appDirs []string

View File

@ -314,14 +314,11 @@ func setUpSearchEntry() *gtk.SearchEntry {
for key := range userDirsMap { for key := range userDirsMap {
if key != "home" { if key != "home" {
fileSearchResults = nil fileSearchResults = nil
if len(fileSearchResults) == 0 {
fileSearchResultFlowBox.Show()
}
searchUserDir(key) searchUserDir(key)
} }
} }
if fileSearchResultFlowBox.GetChildren().Length() == 0 { if fileSearchResultFlowBox.GetChildren().Length() == 0 {
fileSearchResultFlowBox.Hide() fileSearchResultWrapper.Hide()
statusLabel.SetText("0 results") statusLabel.SetText("0 results")
} }
} else { } else {
@ -335,6 +332,7 @@ func setUpSearchEntry() *gtk.SearchEntry {
fileSearchResultFlowBox.Destroy() fileSearchResultFlowBox.Destroy()
} }
appFlowBox = setUpAppsFlowBox(nil, "") appFlowBox = setUpAppsFlowBox(nil, "")
fileSearchResultWrapper.Hide()
} }
}) })
searchEntry.Connect("focus-in-event", func() { searchEntry.Connect("focus-in-event", func() {