This commit is contained in:
akiyosi 2019-10-22 12:04:36 +09:00
parent 124b4d134e
commit 1777efebd1
4 changed files with 319 additions and 67 deletions

View file

@ -1,6 +1,8 @@
package util
import (
"strings"
"github.com/therecipe/qt/gui"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/widgets"
@ -64,6 +66,24 @@ func IsTrue(d interface{}) bool {
return false
}
func SplitVimscript(s string) string {
if string(s[0]) == "\n" {
s = strings.TrimPrefix(s, string("\n"))
}
listLines := "["
lines := strings.Split(s, "\n")
for i, line := range lines {
listLines = listLines + `'` + line + `'`
if i == len(lines)-1 {
listLines = listLines + "]"
} else {
listLines = listLines + ","
}
}
return listLines
}
func DropShadow(x, y, radius float64, alpha int) *widgets.QGraphicsDropShadowEffect{
shadow := widgets.NewQGraphicsDropShadowEffect(nil)
shadow.SetBlurRadius(radius)