theme

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: BSD-3-Clause Imports: 12 Imported by: 225

Documentation

Overview

Package theme defines how a Fyne app should look when rendered

Index

Constants

View Source
const (
	// ColorRed is the red primary color name
	ColorRed = "red"
	// ColorOrange is the orange primary color name
	ColorOrange = "orange"
	// ColorYellow is the yellow primary color name
	ColorYellow = "yellow"
	// ColorGreen is the green primary color name
	ColorGreen = "green"
	// ColorBlue is the blue primary color name
	ColorBlue = "blue"
	// ColorPurple is the purple primary color name
	ColorPurple = "purple"
	// ColorBrown is the brown primary color name
	ColorBrown = "brown"
	// ColorGray is the gray primary color name
	ColorGray = "gray"
)

Variables

This section is empty.

Functions

func BackgroundColor

func BackgroundColor() color.Color

BackgroundColor returns the theme's background color

func ButtonColor

func ButtonColor() color.Color

ButtonColor returns the theme's standard button color.

func CancelIcon

func CancelIcon() fyne.Resource

CancelIcon returns a resource containing the standard cancel icon for the current theme

func CheckButtonCheckedIcon

func CheckButtonCheckedIcon() fyne.Resource

CheckButtonCheckedIcon returns a resource containing the standard checkbox checked icon for the current theme

func CheckButtonIcon

func CheckButtonIcon() fyne.Resource

CheckButtonIcon returns a resource containing the standard checkbox icon for the current theme

func ColorAchromaticIcon added in v1.4.0

func ColorAchromaticIcon() fyne.Resource

ColorAchromaticIcon returns a resource containing the standard achromatic color icon for the current theme

func ColorChromaticIcon added in v1.4.0

func ColorChromaticIcon() fyne.Resource

ColorChromaticIcon returns a resource containing the standard chromatic color icon for the current theme

func ColorPaletteIcon added in v1.4.0

func ColorPaletteIcon() fyne.Resource

ColorPaletteIcon returns a resource containing the standard color palette icon for the current theme

func ComputerIcon added in v1.3.3

func ComputerIcon() fyne.Resource

ComputerIcon returns a resource containing the standard computer icon for the current theme

func ConfirmIcon

func ConfirmIcon() fyne.Resource

ConfirmIcon returns a resource containing the standard confirm icon for the current theme

func ContentAddIcon

func ContentAddIcon() fyne.Resource

ContentAddIcon returns a resource containing the standard content add icon for the current theme

func ContentClearIcon

func ContentClearIcon() fyne.Resource

ContentClearIcon returns a resource containing the standard content clear icon for the current theme

func ContentCopyIcon

func ContentCopyIcon() fyne.Resource

ContentCopyIcon returns a resource containing the standard content copy icon for the current theme

func ContentCutIcon

func ContentCutIcon() fyne.Resource

ContentCutIcon returns a resource containing the standard content cut icon for the current theme

func ContentPasteIcon

func ContentPasteIcon() fyne.Resource

ContentPasteIcon returns a resource containing the standard content paste icon for the current theme

func ContentRedoIcon

func ContentRedoIcon() fyne.Resource

ContentRedoIcon returns a resource containing the standard content redo icon for the current theme

func ContentRemoveIcon

func ContentRemoveIcon() fyne.Resource

ContentRemoveIcon returns a resource containing the standard content remove icon for the current theme

func ContentUndoIcon

func ContentUndoIcon() fyne.Resource

ContentUndoIcon returns a resource containing the standard content undo icon for the current theme

func DarkTheme

func DarkTheme() fyne.Theme

DarkTheme defines the built in dark theme colors and sizes

func DefaultTextBoldFont

func DefaultTextBoldFont() fyne.Resource

DefaultTextBoldFont returns the font resource for the built-in bold font style

func DefaultTextBoldItalicFont

func DefaultTextBoldItalicFont() fyne.Resource

DefaultTextBoldItalicFont returns the font resource for the built-in bold and italic font style

func DefaultTextFont

func DefaultTextFont() fyne.Resource

DefaultTextFont returns the font resource for the built-in regular font style

func DefaultTextItalicFont

func DefaultTextItalicFont() fyne.Resource

DefaultTextItalicFont returns the font resource for the built-in italic font style

func DefaultTextMonospaceFont

func DefaultTextMonospaceFont() fyne.Resource

DefaultTextMonospaceFont returns the font resource for the built-in monospace font face

func DeleteIcon

func DeleteIcon() fyne.Resource

DeleteIcon returns a resource containing the standard delete icon for the current theme

func DisabledButtonColor added in v1.1.0

func DisabledButtonColor() color.Color

DisabledButtonColor returns the theme's disabled button color.

func DisabledIconColor deprecated added in v1.1.0

func DisabledIconColor() color.Color

DisabledIconColor returns the color for a disabledIcon UI element.

Deprecated: Disabled icons match disabled text color for consistency.

func DisabledTextColor added in v1.1.0

func DisabledTextColor() color.Color

DisabledTextColor returns the color for a disabledIcon UI element

func DocumentCreateIcon

func DocumentCreateIcon() fyne.Resource

DocumentCreateIcon returns a resource containing the standard document create icon for the current theme

func DocumentIcon added in v1.3.3

func DocumentIcon() fyne.Resource

DocumentIcon returns a resource containing the standard document icon for the current theme

func DocumentPrintIcon

func DocumentPrintIcon() fyne.Resource

DocumentPrintIcon returns a resource containing the standard document print icon for the current theme

func DocumentSaveIcon

func DocumentSaveIcon() fyne.Resource

DocumentSaveIcon returns a resource containing the standard document save icon for the current theme

func DownloadIcon added in v1.3.3

func DownloadIcon() fyne.Resource

DownloadIcon returns a resource containing the standard download icon for the current theme

func ErrorIcon added in v1.4.0

func ErrorIcon() fyne.Resource

ErrorIcon returns a resource containing the standard dialog error icon for the current theme

func FileApplicationIcon added in v1.3.0

func FileApplicationIcon() fyne.Resource

FileApplicationIcon returns a resource containing the file icon representing application files for the current theme

func FileAudioIcon added in v1.3.0

func FileAudioIcon() fyne.Resource

FileAudioIcon returns a resource containing the file icon representing audio files for the current theme

func FileIcon added in v1.3.0

func FileIcon() fyne.Resource

FileIcon returns a resource containing the appropriate file icon for the current theme

func FileImageIcon added in v1.3.0

func FileImageIcon() fyne.Resource

FileImageIcon returns a resource containing the file icon representing image files for the current theme

func FileTextIcon added in v1.3.0

func FileTextIcon() fyne.Resource

FileTextIcon returns a resource containing the file icon representing text files for the current theme

func FileVideoIcon added in v1.3.0

func FileVideoIcon() fyne.Resource

FileVideoIcon returns a resource containing the file icon representing video files for the current theme

func FocusColor

func FocusColor() color.Color

FocusColor returns the color used to highlight a focused widget

func FolderIcon

func FolderIcon() fyne.Resource

FolderIcon returns a resource containing the standard folder icon for the current theme

func FolderNewIcon

func FolderNewIcon() fyne.Resource

FolderNewIcon returns a resource containing the standard folder creation icon for the current theme

func FolderOpenIcon

func FolderOpenIcon() fyne.Resource

FolderOpenIcon returns a resource containing the standard folder open icon for the current theme

func FyneLogo() fyne.Resource

FyneLogo returns a resource containing the Fyne logo

func HelpIcon

func HelpIcon() fyne.Resource

HelpIcon returns a resource containing the standard help icon for the current theme

func HistoryIcon added in v1.4.0

func HistoryIcon() fyne.Resource

HistoryIcon returns a resource containing the standard history icon for the current theme

func HomeIcon

func HomeIcon() fyne.Resource

HomeIcon returns a resource containing the standard home folder icon for the current theme

func HoverColor added in v1.1.0

func HoverColor() color.Color

HoverColor returns the color used to highlight interactive elements currently under a cursor

func HyperlinkColor deprecated

func HyperlinkColor() color.Color

HyperlinkColor returns the theme's standard hyperlink color.

Deprecated: Hyperlinks now use the primary color for consistency.

func IconColor deprecated added in v1.1.0

func IconColor() color.Color

IconColor returns the theme's standard text color.

Deprecated: Icons now use the text colour for consistency.

func IconInlineSize

func IconInlineSize() int

IconInlineSize is the standard size of icons which appear within buttons, labels etc.

func InfoIcon

func InfoIcon() fyne.Resource

InfoIcon returns a resource containing the standard dialog info icon for the current theme

func LightTheme

func LightTheme() fyne.Theme

LightTheme defines the built in light theme colors and sizes

func MailAttachmentIcon

func MailAttachmentIcon() fyne.Resource

MailAttachmentIcon returns a resource containing the standard mail attachment icon for the current theme

func MailComposeIcon

func MailComposeIcon() fyne.Resource

MailComposeIcon returns a resource containing the standard mail compose icon for the current theme

func MailForwardIcon

func MailForwardIcon() fyne.Resource

MailForwardIcon returns a resource containing the standard mail forward icon for the current theme

func MailReplyAllIcon

func MailReplyAllIcon() fyne.Resource

MailReplyAllIcon returns a resource containing the standard mail reply all icon for the current theme

func MailReplyIcon

func MailReplyIcon() fyne.Resource

MailReplyIcon returns a resource containing the standard mail reply icon for the current theme

func MailSendIcon

func MailSendIcon() fyne.Resource

MailSendIcon returns a resource containing the standard mail send icon for the current theme

func MediaFastForwardIcon added in v1.2.3

func MediaFastForwardIcon() fyne.Resource

MediaFastForwardIcon returns a resource containing the standard media fast-forward icon for the current theme

func MediaFastRewindIcon added in v1.2.3

func MediaFastRewindIcon() fyne.Resource

MediaFastRewindIcon returns a resource containing the standard media fast-rewind icon for the current theme

func MediaPauseIcon added in v1.2.3

func MediaPauseIcon() fyne.Resource

MediaPauseIcon returns a resource containing the standard media pause icon for the current theme

func MediaPlayIcon added in v1.2.3

func MediaPlayIcon() fyne.Resource

MediaPlayIcon returns a resource containing the standard media play icon for the current theme

func MediaRecordIcon added in v1.2.3

func MediaRecordIcon() fyne.Resource

MediaRecordIcon returns a resource containing the standard media record icon for the current theme

func MediaReplayIcon added in v1.2.3

func MediaReplayIcon() fyne.Resource

MediaReplayIcon returns a resource containing the standard media replay icon for the current theme

func MediaSkipNextIcon added in v1.2.3

func MediaSkipNextIcon() fyne.Resource

MediaSkipNextIcon returns a resource containing the standard media skip next icon for the current theme

func MediaSkipPreviousIcon added in v1.2.3

func MediaSkipPreviousIcon() fyne.Resource

MediaSkipPreviousIcon returns a resource containing the standard media skip previous icon for the current theme

func MenuDropDownIcon() fyne.Resource

MenuDropDownIcon returns a resource containing the standard menu drop down icon for the current theme

func MenuDropUpIcon() fyne.Resource

MenuDropUpIcon returns a resource containing the standard menu drop up icon for the current theme

func MenuExpandIcon() fyne.Resource

MenuExpandIcon returns a resource containing the standard (mobile) expand "submenu icon for the current theme

func MenuIcon() fyne.Resource

MenuIcon returns a resource containing the standard (mobile) menu icon for the current theme

func MoveDownIcon

func MoveDownIcon() fyne.Resource

MoveDownIcon returns a resource containing the standard down arrow icon for the current theme

func MoveUpIcon

func MoveUpIcon() fyne.Resource

MoveUpIcon returns a resource containing the standard up arrow icon for the current theme

func NavigateBackIcon() fyne.Resource

NavigateBackIcon returns a resource containing the standard backward navigation icon for the current theme

func NavigateNextIcon() fyne.Resource

NavigateNextIcon returns a resource containing the standard forward navigation icon for the current theme

func Padding

func Padding() int

Padding is the standard gap between elements and the border around interface elements

func PlaceHolderColor

func PlaceHolderColor() color.Color

PlaceHolderColor returns the theme's standard text color

func PrimaryColor

func PrimaryColor() color.Color

PrimaryColor returns the color used to highlight primary features

func PrimaryColorNamed added in v1.4.0

func PrimaryColorNamed(name string) color.Color

PrimaryColorNamed returns a theme specific color value for a named primary color.

func PrimaryColorNames added in v1.4.0

func PrimaryColorNames() []string

PrimaryColorNames returns a list of the standard primary color options.

func QuestionIcon

func QuestionIcon() fyne.Resource

QuestionIcon returns a resource containing the standard dialog question icon for the current theme

func RadioButtonCheckedIcon

func RadioButtonCheckedIcon() fyne.Resource

RadioButtonCheckedIcon returns a resource containing the standard radio button checked icon for the current theme

func RadioButtonIcon

func RadioButtonIcon() fyne.Resource

RadioButtonIcon returns a resource containing the standard radio button icon for the current theme

func ScrollBarColor

func ScrollBarColor() color.Color

ScrollBarColor returns the color (and translucency) for a scrollBar

func ScrollBarSize

func ScrollBarSize() int

ScrollBarSize is the width (or height) of the bars on a ScrollContainer

func ScrollBarSmallSize added in v1.1.0

func ScrollBarSmallSize() int

ScrollBarSmallSize is the width (or height) of the minimized bars on a ScrollContainer

func SearchIcon

func SearchIcon() fyne.Resource

SearchIcon returns a resource containing the standard search icon for the current theme

func SearchReplaceIcon

func SearchReplaceIcon() fyne.Resource

SearchReplaceIcon returns a resource containing the standard search and replace icon for the current theme

func SettingsIcon added in v1.1.0

func SettingsIcon() fyne.Resource

SettingsIcon returns a resource containing the standard settings icon for the current theme

func ShadowColor added in v1.1.0

func ShadowColor() color.Color

ShadowColor returns the color (and translucency) for shadows used for indicating elevation

func StorageIcon added in v1.3.3

func StorageIcon() fyne.Resource

StorageIcon returns a resource containing the standard storage icon for the current theme

func TextBoldFont

func TextBoldFont() fyne.Resource

TextBoldFont returns the font resource for the bold font style

func TextBoldItalicFont

func TextBoldItalicFont() fyne.Resource

TextBoldItalicFont returns the font resource for the bold and italic font style

func TextColor

func TextColor() color.Color

TextColor returns the theme's standard text color

func TextFont

func TextFont() fyne.Resource

TextFont returns the font resource for the regular font style

func TextItalicFont

func TextItalicFont() fyne.Resource

TextItalicFont returns the font resource for the italic font style

func TextMonospaceFont

func TextMonospaceFont() fyne.Resource

TextMonospaceFont returns the font resource for the monospace font face

func TextSize

func TextSize() int

TextSize returns the standard text size

func ViewFullScreenIcon

func ViewFullScreenIcon() fyne.Resource

ViewFullScreenIcon returns a resource containing the standard fullscreen icon for the current theme

func ViewRefreshIcon

func ViewRefreshIcon() fyne.Resource

ViewRefreshIcon returns a resource containing the standard refresh icon for the current theme

func ViewRestoreIcon

func ViewRestoreIcon() fyne.Resource

ViewRestoreIcon returns a resource containing the standard exit fullscreen icon for the current theme

func VisibilityIcon added in v1.2.0

func VisibilityIcon() fyne.Resource

VisibilityIcon returns a resource containing the standard visibity icon for the current theme

func VisibilityOffIcon added in v1.2.0

func VisibilityOffIcon() fyne.Resource

VisibilityOffIcon returns a resource containing the standard visibity off icon for the current theme

func VolumeDownIcon added in v1.2.3

func VolumeDownIcon() fyne.Resource

VolumeDownIcon returns a resource containing the standard volume down icon for the current theme

func VolumeMuteIcon added in v1.2.3

func VolumeMuteIcon() fyne.Resource

VolumeMuteIcon returns a resource containing the standard volume mute icon for the current theme

func VolumeUpIcon added in v1.2.3

func VolumeUpIcon() fyne.Resource

VolumeUpIcon returns a resource containing the standard volume up icon for the current theme

func WarningIcon

func WarningIcon() fyne.Resource

WarningIcon returns a resource containing the standard dialog warning icon for the current theme

func ZoomFitIcon

func ZoomFitIcon() fyne.Resource

ZoomFitIcon returns a resource containing the standard zoom fit icon for the current theme

func ZoomInIcon

func ZoomInIcon() fyne.Resource

ZoomInIcon returns a resource containing the standard zoom in icon for the current theme

func ZoomOutIcon

func ZoomOutIcon() fyne.Resource

ZoomOutIcon returns a resource containing the standard zoom out icon for the current theme

Types

type DisabledResource added in v1.1.0

type DisabledResource struct {
	// contains filtered or unexported fields
}

DisabledResource is a resource wrapper that will return an appropriate resource colorized by the current theme's `DisabledIconColor` color.

func NewDisabledResource added in v1.1.0

func NewDisabledResource(res fyne.Resource) *DisabledResource

NewDisabledResource creates a resource that adapts to the current theme's DisabledIconColor setting.

func (*DisabledResource) Content added in v1.1.0

func (res *DisabledResource) Content() []byte

Content returns the disabled style content of the correct resource for the current theme

func (*DisabledResource) Name added in v1.1.0

func (res *DisabledResource) Name() string

Name returns the resource source name prefixed with `disabled_` (used for caching)

type ErrorThemedResource added in v1.4.0

type ErrorThemedResource struct {
	// contains filtered or unexported fields
}

ErrorThemedResource is a resource wrapper that will return a version of the resource with the main color changed to indicate an error.

func NewErrorThemedResource added in v1.4.0

func NewErrorThemedResource(orig fyne.Resource) *ErrorThemedResource

NewErrorThemedResource creates a resource that adapts to the error color for the current theme.

func (*ErrorThemedResource) Content added in v1.4.0

func (res *ErrorThemedResource) Content() []byte

Content returns the underlying content of the resource adapted to the current background color.

func (*ErrorThemedResource) Name added in v1.4.0

func (res *ErrorThemedResource) Name() string

Name returns the underlying resource name (used for caching).

func (*ErrorThemedResource) Original added in v1.4.0

func (res *ErrorThemedResource) Original() fyne.Resource

Original returns the underlying resource that this error themed resource was adapted from

type InvertedThemedResource added in v1.4.0

type InvertedThemedResource struct {
	// contains filtered or unexported fields
}

InvertedThemedResource is a resource wrapper that will return a version of the resource with the main color changed for use over highlighted elements.

func NewInvertedThemedResource added in v1.4.0

func NewInvertedThemedResource(orig fyne.Resource) *InvertedThemedResource

NewInvertedThemedResource creates a resource that adapts to the current theme for use over highlighted elements.

func (*InvertedThemedResource) Content added in v1.4.0

func (res *InvertedThemedResource) Content() []byte

Content returns the underlying content of the resource adapted to the current background color.

func (*InvertedThemedResource) Name added in v1.4.0

func (res *InvertedThemedResource) Name() string

Name returns the underlying resource name (used for caching).

func (*InvertedThemedResource) Original added in v1.4.0

func (res *InvertedThemedResource) Original() fyne.Resource

Original returns the underlying resource that this inverted themed resource was adapted from

type PrimaryThemedResource added in v1.4.0

type PrimaryThemedResource struct {
	// contains filtered or unexported fields
}

PrimaryThemedResource is a resource wrapper that will return a version of the resource with the main color changed to the theme primary color.

func NewPrimaryThemedResource added in v1.4.0

func NewPrimaryThemedResource(orig fyne.Resource) *PrimaryThemedResource

NewPrimaryThemedResource creates a resource that adapts to the primary color for the current theme.

func (*PrimaryThemedResource) Content added in v1.4.0

func (res *PrimaryThemedResource) Content() []byte

Content returns the underlying content of the resource adapted to the current background color.

func (*PrimaryThemedResource) Name added in v1.4.0

func (res *PrimaryThemedResource) Name() string

Name returns the underlying resource name (used for caching).

func (*PrimaryThemedResource) Original added in v1.4.0

func (res *PrimaryThemedResource) Original() fyne.Resource

Original returns the underlying resource that this primary themed resource was adapted from

type ThemedResource

type ThemedResource struct {
	// contains filtered or unexported fields
}

ThemedResource is a resource wrapper that will return a version of the resource with the main color changed for the currently selected theme.

func NewThemedResource deprecated

func NewThemedResource(src, ignored fyne.Resource) *ThemedResource

NewThemedResource creates a resource that adapts to the current theme setting.

Deprecated: NewThemedResource() will be replaced with a single parameter version in a future release usage of this method will break, but using the first parameter only will be a trivial change.

func (*ThemedResource) Content

func (res *ThemedResource) Content() []byte

Content returns the underlying content of the resource adapted to the current text color.

func (*ThemedResource) Error added in v1.4.0

func (res *ThemedResource) Error() *ErrorThemedResource

Error returns a different resource for indicating an error.

func (*ThemedResource) Name

func (res *ThemedResource) Name() string

Name returns the underlying resource name (used for caching).

Jump to

Keyboard shortcuts

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