コード例 #1
0
ファイル: cycle.go プロジェクト: pascience/foci
	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
コード例 #2
0
ファイル: main.go プロジェクト: pascience/foci
	"github.com/BurntSushi/xgbutil/keybind"
	"github.com/BurntSushi/xgbutil/xevent"
	"github.com/BurntSushi/xgbutil/xgraphics"
	"github.com/BurntSushi/xgbutil/xwindow"

	"github.com/pascience/wingo/misc"
	"github.com/pascience/wingo/render"
	"github.com/pascience/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)