Пример #1
0
func DefaultFullTheme(X *xgbutil.XUtil) *FullTheme {
	return &FullTheme{
		Font: xgraphics.MustFont(xgraphics.ParseFont(
			bytes.NewBuffer(misc.DejavusansTtf))),
		FontSize:   15,
		AFontColor: render.NewColor(0xffffff),
		IFontColor: render.NewColor(0x000000),

		TitleSize:   25,
		ATitleColor: render.NewColor(0x3366ff),
		ITitleColor: render.NewColor(0xdfdcdf),

		ACloseButton: builtInButton(X, misc.ClosePng),
		ICloseButton: builtInButton(X, misc.ClosePng),

		AMaximizeButton: builtInButton(X, misc.MaximizePng),
		IMaximizeButton: builtInButton(X, misc.MaximizePng),

		AMinimizeButton: builtInButton(X, misc.MinimizePng),
		IMinimizeButton: builtInButton(X, misc.MinimizePng),

		BorderSize:   10,
		ABorderColor: render.NewColor(0x3366ff),
		IBorderColor: render.NewColor(0xdfdcdf),
	}
}
Пример #2
0
	ActiveFontColor render.Color

	GroupBgColor   render.Color
	GroupFont      *truetype.Font
	GroupFontSize  float64
	GroupFontColor render.Color
	GroupSpacing   int
}

var DefaultSelectTheme = &SelectTheme{
	BorderSize:  10,
	BgColor:     render.NewImageColor(color.RGBA{0xff, 0xff, 0xff, 0xff}),
	BorderColor: render.NewImageColor(color.RGBA{0x0, 0x0, 0x0, 0xff}),
	Padding:     20,

	Font: xgraphics.MustFont(xgraphics.ParseFont(
		bytes.NewBuffer(bindata.DejavusansTtf()))),
	FontSize:  20.0,
	FontColor: render.NewImageColor(color.RGBA{0x0, 0x0, 0x0, 0xff}),

	ActiveBgColor:   render.NewImageColor(color.RGBA{0x0, 0x0, 0x0, 0xff}),
	ActiveFontColor: render.NewImageColor(color.RGBA{0xff, 0xff, 0xff, 0xff}),

	GroupBgColor: render.NewImageColor(color.RGBA{0xff, 0xff, 0xff, 0xff}),
	GroupFont: xgraphics.MustFont(xgraphics.ParseFont(
		bytes.NewBuffer(bindata.DejavusansTtf()))),
	GroupFontSize:  25.0,
	GroupFontColor: render.NewImageColor(color.RGBA{0x33, 0x66, 0xff, 0xff}),
	GroupSpacing:   15,
}

type SelectConfig struct {
Пример #3
0
	ActiveFontColor render.Color

	GroupBgColor   render.Color
	GroupFont      *truetype.Font
	GroupFontSize  float64
	GroupFontColor render.Color
	GroupSpacing   int
}

var DefaultSelectTheme = &SelectTheme{
	BorderSize:  10,
	BgColor:     render.NewImageColor(color.RGBA{0xff, 0xff, 0xff, 0xff}),
	BorderColor: render.NewImageColor(color.RGBA{0x0, 0x0, 0x0, 0xff}),
	Padding:     20,

	Font: xgraphics.MustFont(xgraphics.ParseFont(
		bytes.NewBuffer(misc.DataFile("DejaVuSans.ttf")))),
	FontSize:  20.0,
	FontColor: render.NewImageColor(color.RGBA{0x0, 0x0, 0x0, 0xff}),

	ActiveBgColor:   render.NewImageColor(color.RGBA{0x0, 0x0, 0x0, 0xff}),
	ActiveFontColor: render.NewImageColor(color.RGBA{0xff, 0xff, 0xff, 0xff}),

	GroupBgColor: render.NewImageColor(color.RGBA{0xff, 0xff, 0xff, 0xff}),
	GroupFont: xgraphics.MustFont(xgraphics.ParseFont(
		bytes.NewBuffer(misc.DataFile("DejaVuSans.ttf")))),
	GroupFontSize:  25.0,
	GroupFontColor: render.NewImageColor(color.RGBA{0x33, 0x66, 0xff, 0xff}),
	GroupSpacing:   15,
}

type SelectConfig struct {
Пример #4
0
	"github.com/BurntSushi/xgb/xproto"

	"github.com/BurntSushi/xgbutil"
	"github.com/BurntSushi/xgbutil/keybind"
	"github.com/BurntSushi/xgbutil/xevent"
	"github.com/BurntSushi/xgbutil/xgraphics"
	"github.com/BurntSushi/xgbutil/xwindow"

	"github.com/BurntSushi/wingo/bindata"
	"github.com/BurntSushi/wingo/render"
	"github.com/BurntSushi/wingo/text"
)

var (
	// A near guaranteed font. If parsing fails, MustFont wll panic.
	font = xgraphics.MustFont(xgraphics.ParseFont(
		bytes.NewBuffer(bindata.FreemonoTtf())))
	fontSize  = 30.0
	fontColor = render.NewImageColor(color.RGBA{0x0, 0x0, 0x0, 0xff})
	bgColor   = render.NewImageColor(color.RGBA{0xff, 0xff, 0xff, 0xff})
	width     = 800
	padding   = 10
)

func fatal(err error) {
	if err != nil {
		log.Fatal(err)
	}
}

func main() {
	X, err := xgbutil.NewConn()