1 Commits

Author SHA1 Message Date
piotr
f3b3635bd8 trim comments > 120 chars #61 2022-05-08 01:43:16 +02:00
2 changed files with 6 additions and 1 deletions

View File

@@ -21,7 +21,7 @@ import (
"github.com/gotk3/gotk3/gtk" "github.com/gotk3/gotk3/gtk"
) )
const version = "0.2.9" const version = "0.3.0"
var ( var (
appDirs []string appDirs []string

View File

@@ -258,6 +258,11 @@ func flowBoxButton(entry desktopEntry) *gtk.Button {
exec := entry.Exec exec := entry.Exec
terminal := entry.Terminal terminal := entry.Terminal
desc := entry.CommentLoc desc := entry.CommentLoc
if len(desc) > 120 {
r := []rune(desc)
desc = string(r[:117])
desc = fmt.Sprintf("%s…", desc)
}
button.Connect("button-release-event", func(btn *gtk.Button, e *gdk.Event) bool { button.Connect("button-release-event", func(btn *gtk.Button, e *gdk.Event) bool {
btnEvent := gdk.EventButtonNewFromEvent(e) btnEvent := gdk.EventButtonNewFromEvent(e)
if btnEvent.Button() == 1 { if btnEvent.Button() == 1 {