Skip to content

Commit

Permalink
Make revision link to be open instead of copy
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaiR committed Mar 31, 2022
1 parent a24431b commit 98b5930
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/app/about.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package app

import (
"fmt"
"github.com/skratchdot/open-golang/open"
"log"
"sdmm/app/ui/dialog"
"sdmm/env"
w "sdmm/imguiext/widget"
"sdmm/platform"
"sdmm/rsc"
)

Expand All @@ -27,9 +27,11 @@ func (a *app) openAboutWindow() {
w.SameLine(),
w.Button(env.Revision, func() {
link := fmt.Sprintf("%s/tree/%s", env.GitHub, env.Revision)
log.Println("[app] copy revision link:", link)
platform.SetClipboard(link) // open in browser doesn't work for some reason
}).Tooltip("Copy link to clipboard").Small(true),
log.Println("[app] do open revision link:", link)
if err := open.Run(link); err != nil {
log.Println("[app] unable to open revision link:", err)
}
}).Small(true),
},
})
}

0 comments on commit 98b5930

Please sign in to comment.