settings

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DialogIcon

type DialogIcon uint

DialogIcon is the enumeration for dialog icons.

const (
	UndefinedIcon DialogIcon = iota
	ErrorIcon
	WarningIcon
	InfoIcon
	QuestionIcon
)

The stock dialog icons.

type Entry

type Entry struct {
	General
	GeneralText
	GeneralButton

	DefaultEntry     string
	HideDefaultEntry bool

	Icon DialogIcon // Only on macOS supported.
}

Entry are options for the entry dialog.

type FileFilter

type FileFilter struct {
	Name     string   // Name that describes the filter (optional).
	Patterns []string // Filter patterns for the display string.
}

FileFilter is file filter for the file dialog.

type FileSave

type FileSave struct {
	General
	GeneralFile

	// Confirm if the file get overwritten.
	// Cannot be disabled on macOS.
	ConfirmOverwrite bool

	// Confirm if the file does not exist.
	ConfirmCreate bool // Windows only.
}

FileSave are options for the file dialog.

type FileSelection

type FileSelection struct {
	General
	GeneralFile

	MultipleSelection bool
}

FileSelection are options for the file dialog. Note: Adding member -> Check Conversion from `FileSave` -> `FileSelection`.

type General

type General struct {
	Title  string
	Width  uint
	Height uint

	WindowIcon DialogIcon
}

General Dialog settings are default settings for all dialogs.

type GeneralButton

type GeneralButton struct {
	OkLabel       string
	CancelLabel   string
	DefaultCancel bool

	ExtraButtons []string // On macOS only one additional button is allowed.
}

GeneralButton are default settings for the standard buttons on certain dialogs.

type GeneralFile

type GeneralFile struct {
	// Root directory of the file dialog. (default is current working dir)
	Root string

	// Default file/directory name in the dialog.
	Filename string

	// File filter.
	FileFilters []FileFilter

	// Show hidden files.
	ShowHidden bool // Windows and macOS only.

	// Select only directories.
	OnlyDirectories bool
}

GeneralFile are general options for file dialog.

type GeneralText

type GeneralText struct {
	Text      string
	NoWrap    bool
	Ellipsize bool
}

GeneralText are default text settings for certain dialogs.

type Message

type Message struct {
	General
	GeneralText
	GeneralButton

	Style MessageStyle
	Icon  DialogIcon
}

Message are options for the message dialog.

func (*Message) SetDefaultIcons

func (s *Message) SetDefaultIcons()

type MessageStyle

type MessageStyle uint

MessageStyle is the message style.

const (
	InfoStyle MessageStyle = iota
	WarningStyle
	ErrorStyle
	QuestionStyle
)

The message styles.

type Notification

type Notification struct {
	General

	Text string
}

Notification are options for the notification.

type Options

type Options struct {
	General
	GeneralText
	GeneralButton

	Options        []string
	DefaultOptions []uint

	Style             OptionsStyle
	MultipleSelection bool
}

Options are options for the options dialog.

type OptionsStyle

type OptionsStyle uint

OptionsStyle is the style with which the list dialog is rendered.

const (
	// OptionsStyleList renders the list dialog with a selection list.
	OptionsStyleList OptionsStyle = iota

	// OptionsStyleButtons renders the list dialog with a buttons list.
	// Multiple selections can therefore not be performed.
	// Unsupported at the moment.
	OptionsStyleButtons
)

Jump to

Keyboard shortcuts

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