mirror of
https://github.com/nwg-piotr/nwg-drawer.git
synced 2024-10-26 14:53:57 +03:00
trim comments > 120 chars #61
This commit is contained in:
parent
bb84a2fc46
commit
f3b3635bd8
2
main.go
2
main.go
@ -21,7 +21,7 @@ import (
|
||||
"github.com/gotk3/gotk3/gtk"
|
||||
)
|
||||
|
||||
const version = "0.2.9"
|
||||
const version = "0.3.0"
|
||||
|
||||
var (
|
||||
appDirs []string
|
||||
|
@ -258,6 +258,11 @@ func flowBoxButton(entry desktopEntry) *gtk.Button {
|
||||
exec := entry.Exec
|
||||
terminal := entry.Terminal
|
||||
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 {
|
||||
btnEvent := gdk.EventButtonNewFromEvent(e)
|
||||
if btnEvent.Button() == 1 {
|
||||
|
Loading…
Reference in New Issue
Block a user