mirror of
https://github.com/nwg-piotr/nwg-drawer.git
synced 2024-08-16 09:10:21 +03:00
fix GTK warnings on pinned cache not found #6
This commit is contained in:
parent
27718a9f1b
commit
eb358b24cd
1
main.go
1
main.go
@ -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)
|
||||
|
||||
|
@ -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)))
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user