Skip to content

Commit

Permalink
Merge pull request #7 from nwg-piotr/fix_pinned
Browse files Browse the repository at this point in the history
Fix GTK critical warnings on pinned cache file not found
  • Loading branch information
nwg-piotr authored Jul 12, 2021
2 parents 27718a9 + 4bf82d9 commit 955429d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Binary file modified bin/nwg-drawer
Binary file not shown.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/gotk3/gotk3/gtk"
)

const version = "0.1.3"
const version = "0.1.4"

var (
appDirs []string
Expand Down Expand Up @@ -172,6 +172,7 @@ func main() {
if err != nil {
pinned = nil
}
println(fmt.Sprintf("Found %v pinned items", len(pinned)))

cssFile := filepath.Join(configDirectory, *cssFileName)

Expand Down
13 changes: 7 additions & 6 deletions uicomponents.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func setUpPinnedFlowBox() *gtk.FlowBox {
flowBox, _ := gtk.FlowBoxNew()
if uint(len(pinned)) >= *columnsNumber {
flowBox.SetMaxChildrenPerLine(*columnsNumber)
} else {
} else if len(pinned) > 0 {
flowBox.SetMaxChildrenPerLine(uint(len(pinned)))
}

Expand Down Expand Up @@ -78,16 +78,17 @@ func setUpPinnedFlowBox() *gtk.FlowBox {
})
flowBox.Add(btn)
}
pinnedFlowBoxWrapper.PackStart(flowBox, true, false, 0)

//While moving focus with arrow keys we want buttons to get focus directly
flowBox.GetChildren().Foreach(func(item interface{}) {
item.(*gtk.Widget).SetCanFocus(false)
})
}
flowBox.Connect("enter-notify-event", func() {
cancelClose()
})

pinnedFlowBoxWrapper.PackStart(flowBox, true, false, 0)
//While moving focus with arrow keys we want buttons to get focus directly
flowBox.GetChildren().Foreach(func(item interface{}) {
item.(*gtk.Widget).SetCanFocus(false)
})
flowBox.ShowAll()

return flowBox
Expand Down

0 comments on commit 955429d

Please sign in to comment.