本文整理匯總了Golang中github.com/BurntSushi/wingo/render.NewBorder函數的典型用法代碼示例。如果您正苦於以下問題:Golang NewBorder函數的具體用法?Golang NewBorder怎麽用?Golang NewBorder使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了NewBorder函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: borderImages
func (f *Full) borderImages(
width, height int) (*xgraphics.Image, *xgraphics.Image) {
imgA := render.NewBorder(f.X, 0, render.NoColor, f.theme.ABorderColor,
width, height, 0, 0)
imgI := render.NewBorder(f.X, 0, render.NoColor, f.theme.IBorderColor,
width, height, 0, 0)
return imgA.Image, imgI.Image
}
示例2: pieceImages
func (f *Borders) pieceImages(borderTypes, gradientType, gradientDir,
width, height int) (*xgraphics.Image, *xgraphics.Image) {
imgA := render.NewBorder(f.X, borderTypes,
f.theme.AThinColor, f.theme.ABorderColor,
width, height, gradientType, gradientDir)
imgI := render.NewBorder(f.X, borderTypes,
f.theme.IThinColor, f.theme.IBorderColor,
width, height, gradientType, gradientDir)
return imgA.Image, imgI.Image
}
示例3: newTitleBar
func (f *Full) newTitleBar() *piece {
imgA := render.NewBorder(f.X, 0, render.NoColor, f.theme.ATitleColor,
1, f.theme.TitleSize,
render.GradientVert, render.GradientRegular)
imgI := render.NewBorder(f.X, 0, render.NoColor, f.theme.ITitleColor,
1, f.theme.TitleSize,
render.GradientVert, render.GradientRegular)
win := f.newPieceWindow("titlebar", 0)
win.MROpt(fX|fY|fH,
f.theme.BorderSize, f.theme.BorderSize,
0, f.theme.TitleSize)
return newPiece(win, imgA.Image, imgI.Image)
}
示例4: newButtonMinimize
func (f *Full) newButtonMinimize() *piece {
imgA := render.NewBorder(f.X, 0, render.NoColor, f.theme.ATitleColor,
f.theme.TitleSize, f.theme.TitleSize,
render.GradientVert, render.GradientRegular)
imgI := render.NewBorder(f.X, 0, render.NoColor, f.theme.ITitleColor,
f.theme.TitleSize, f.theme.TitleSize,
render.GradientVert, render.GradientRegular)
xgraphics.Blend(imgA.Image, f.theme.AMinimizeButton, image.ZP)
xgraphics.Blend(imgI.Image, f.theme.IMinimizeButton, image.ZP)
win := f.newPieceWindow("minimize", 0)
win.MROpt(fY|fW|fH,
0, f.theme.BorderSize,
f.theme.TitleSize, f.theme.TitleSize)
return newPiece(win, imgA.Image, imgI.Image)
}
示例5: UpdateTitle
func (f *Full) UpdateTitle() {
if f == nil {
return
}
title := f.client.Name()
font := f.theme.Font
fontSize := f.theme.FontSize
aFontColor := f.theme.AFontColor.ImageColor()
iFontColor := f.theme.IFontColor.ImageColor()
ew, eh := xgraphics.TextMaxExtents(font, fontSize, title)
eh += misc.TextBreathe
imgA := render.NewBorder(f.X, 0, render.NoColor, f.theme.ATitleColor,
ew, f.theme.TitleSize,
render.GradientVert, render.GradientRegular)
imgI := render.NewBorder(f.X, 0, render.NoColor, f.theme.ITitleColor,
ew, f.theme.TitleSize,
render.GradientVert, render.GradientRegular)
y := (f.theme.TitleSize-eh)/2 - 1
x2, _, err := imgA.Text(0, y, aFontColor, fontSize, font, title)
if err != nil {
logger.Warning.Printf("Could not draw window title for window %s "+
"because: %v", f.client, err)
}
_, _, err = imgI.Text(0, y, iFontColor, fontSize, font, title)
if err != nil {
logger.Warning.Printf("Could not draw window title for window %s "+
"because: %v", f.client, err)
}
f.titleText.Create(
imgA.SubImage(image.Rect(0, 0, x2, imgA.Bounds().Max.Y)),
imgI.SubImage(image.Rect(0, 0, x2, imgI.Bounds().Max.Y)))
f.titleText.MROpt(fW, 0, 0, x2, 0)
if f.client.State() == Active {
f.titleText.Active()
} else {
f.titleText.Inactive()
}
}
示例6: UpdateIcon
func (f *Full) UpdateIcon() {
size := f.theme.TitleSize
imgA := render.NewBorder(f.X, 0, render.NoColor, f.theme.ATitleColor,
size, size, render.GradientVert, render.GradientRegular)
imgI := render.NewBorder(f.X, 0, render.NoColor, f.theme.ITitleColor,
size, size, render.GradientVert, render.GradientRegular)
img := f.client.Icon(size-4, size-4)
sub := image.Rect(2, 2, size-2, size-2)
xgraphics.Blend(imgA.SubImage(sub), img, image.ZP)
xgraphics.Blend(imgI.SubImage(sub), img, image.ZP)
f.icon.Create(imgA.Image, imgI.Image)
if f.client.State() == Active {
f.icon.Active()
} else {
f.icon.Inactive()
}
}