Exemple #1
0
	FontSize  float64
	FontColor render.Color

	ActiveBgColor   render.Color
	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,
Exemple #2
0
	BgColor     render.Color
	BorderColor render.Color
	Padding     int

	Font      *truetype.Font
	FontSize  float64
	FontColor render.Color

	IconSize         int
	IconBorderSize   int
	IconTransparency int
}

var DefaultCycleTheme = &CycleTheme{
	BorderSize:  10,
	BgColor:     render.NewImageColor(color.RGBA{0xff, 0xff, 0xff, 0xff}),
	BorderColor: render.NewImageColor(color.RGBA{0x0, 0x0, 0x0, 0xff}),
	Padding:     10,
	Font: xgraphics.MustFont(xgraphics.ParseFont(
		bytes.NewBuffer(misc.DataFile("DejaVuSans.ttf")))),
	FontSize:         20.0,
	FontColor:        render.NewImageColor(color.RGBA{0x0, 0x0, 0x0, 0xff}),
	IconSize:         100,
	IconBorderSize:   5,
	IconTransparency: 50,
}

// CycleConfig values can be used to create prompts with different
// configurations. As of right now, the only configuration options supported
// is whether to issue a keyboard grab and the key to
// use to "cancel" the prompt. (If empty, no cancel key feature will be used
Exemple #3
0
	"github.com/BurntSushi/xgbutil/keybind"
	"github.com/BurntSushi/xgbutil/xevent"
	"github.com/BurntSushi/xgbutil/xgraphics"
	"github.com/BurntSushi/xgbutil/xwindow"

	"github.com/BurntSushi/wingo/misc"
	"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(misc.DataFile("DejaVuSans.ttf"))))
	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()
	fatal(err)