splash

package
v1.7.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package splash contains routines to run Vinegar's splash window.

Index

Constants

This section is empty.

Variables

View Source
var ErrClosed = errors.New("window closed")

Functions

func XDGOpen added in v1.7.0

func XDGOpen(file string) *exec.Cmd

XDGOpen makes a *exec.Cmd with xdg-open as the named program.

Types

type C

type C = layout.Context

type Config added in v1.6.0

type Config struct {
	Enabled     bool   `toml:"enabled"`     // Determines if splash is shown or not
	LogoPath    string `toml:"logo_path"`   // Logo file path used to load and render the logo
	Style       string `toml:"style"`       // Style to use for the splash layout
	BgColor     uint32 `toml:"background"`  // Foreground color
	FgColor     uint32 `toml:"foreground"`  // Background color
	CancelColor uint32 `toml:"cancel,red"`  // Background color for the Cancel button
	AccentColor uint32 `toml:"accent"`      // Color for progress bar's track and ShowLog button
	TrackColor  uint32 `toml:"track,gray1"` // Color for the progress bar's background
	InfoColor   uint32 `toml:"info,gray2"`  // Foreground color for the text containing binary information
}

type D

type D = layout.Dimensions

type ProgressBarStyle

type ProgressBarStyle struct {
	Color      color.NRGBA
	TrackColor color.NRGBA
	Progress   float32
}

func ProgressBar

func ProgressBar(th *material.Theme, progress float32) ProgressBarStyle

func (ProgressBarStyle) Layout

type Splash

type Splash struct {
	*app.Window

	Theme  *material.Theme
	Config *Config
	Style
	LogPath string
	// contains filtered or unexported fields
}

func New

func New(cfg *Config) *Splash

func (*Splash) Close

func (ui *Splash) Close()

func (*Splash) Dialog

func (ui *Splash) Dialog(txt string, user bool) (r bool)

Make a new application window using vinegar's existing properties to simulate a dialog. user parameter dictates if Dialog returns a boolean based on if the user clicked 'Yes' or 'No' on the dialog, otherwise it will only make an 'Okay' button.

The dialog window size will automatically resize itself vertically according to how many lines the text takes.

func (*Splash) IsClosed

func (ui *Splash) IsClosed() bool

func (*Splash) Run

func (ui *Splash) Run() error

func (*Splash) SetDesc

func (ui *Splash) SetDesc(desc string)

func (*Splash) SetMessage

func (ui *Splash) SetMessage(msg string)

func (*Splash) SetProgress

func (ui *Splash) SetProgress(progress float32)

type Style

type Style int
const (
	Compact Style = iota
	Familiar
)

func (Style) Size

func (s Style) Size() (w, h unit.Dp)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL