trim string, not runes #62

This commit is contained in:
piotr
2022-05-16 01:01:25 +02:00
parent f3b3635bd8
commit 02b3930ef9

View File

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