design

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ThemeBackground uint32 = 0xFF202020

ThemeBackground is the colour for most page content.

View Source
const ThemeBackgroundSearch uint32 = 0xFF101010

ThemeBackgroundSearch is the colour for searchboxbackground

View Source
const ThemeBackgroundTitle uint32 = 0xFF404040

ThemeBackgroundTitle is the colour for the page title background.

View Source
const ThemeBackgroundUnderlayer uint32 = 0xFF101010

ThemeBackgroundUnderlayer is the colour for backgrounds in "underground" lists.

View Source
const ThemeBackgroundWarning uint32 = 0xFFFFA000

ThemeBackgroundWarning is the colour for warning backgrounds.

View Source
const ThemeImpossibleActionButton uint32 = 0xFF404040

ThemeImpossibleActionButton is the colour for buttons that fail, but will explain why it is impossible.

View Source
const ThemeOkActionButton uint32 = 0xFF2040FF

ThemeOkActionButton is the colour for OK or Install buttons.

View Source
const ThemePlaceholder uint32 = 0xFFFF0000

ThemePlaceholder is the colour for placeholders.

View Source
const ThemeRemoveActionButton uint32 = 0xFFB11E1E

ThemeRemoveActionButton is the colour for Remove buttons.

View Source
const ThemeSubText uint32 = 0xFFC0C0C0

ThemeSubText is for 'detail' text that doesn't matter that much.

View Source
const ThemeText uint32 = 0xFFFFFFFF

ThemeText is the colour for most text.

View Source
const ThemeTextInputHint = 0xFF808080

ThemeTextInputHint is the colour for text hints

View Source
const ThemeTextInputSuggestion = 0xFF80FF80

ThemeTextInputSuggestion is the colour for text input suggestions.

View Source
const ThemeTextWarning uint32 = 0xFF000000

ThemeTextWarning is the colour for warning text.

View Source
const ThemeUpdateActionButton uint32 = 0xFFD28C44

ThemeUpdateActionButton is the colour for Update buttons.

Variables

View Source
var ButtonTextFont font.Face

ButtonTextFont for buttons

View Source
var DesignScale float64

DesignScale is the current scale for the Design.

View Source
var GlobalFont font.Face

GlobalFont for most text

View Source
var ListItemSubTextFont font.Face

ListItemSubTextFont for undertext

View Source
var ListItemTextFont font.Face

ListItemTextFont for main list item text

View Source
var PageTitleFont font.Face

PageTitleFont for a page title

View Source
var ScrollbarThemeH framework.ScrollbarTheme

ScrollbarThemeH is the ScrollbarTheme for horizontal scrollbars.

View Source
var ScrollbarThemeV framework.ScrollbarTheme

ScrollbarThemeV is the ScrollbarTheme for vertical scrollbars.

View Source
var ScrollboxExterior framework.NinePatchFrame

ScrollboxExterior should be wrapped around scrollboxen.

View Source
var SizeMarginAroundEverything int32

SizeMarginAroundEverything is a useful margin around the body, etc.

View Source
var SizeTextNudge int32

SizeTextNudge is the amount to nudge text vertically downwards to make it seem even.

View Source
var SizeWindow frenyard.Vec2i

SizeWindow is the size of the main window.

View Source
var SizeWindowInit frenyard.Vec2i = frenyard.Vec2i{X: 568, Y: 320}

SizeWindowInit is the size of the main window at 1x scale (used for initialization)

Functions

func BorderTitle

func BorderTitle(colour uint32) framework.Frame

BorderTitle produces a border for the shadowing effect under a title.

func ButtonAction

func ButtonAction(colour uint32, text string, behavior framework.ButtonBehavior) *framework.UIButton

ButtonAction creates a 'OK' button for some given text (likely 'OK')

func ButtonBar

ButtonBar provides a 'button-bar' to put at the bottom of dialogs.

func ButtonIcon

func ButtonIcon(icon IconID, dp int32, click framework.ButtonBehavior) *framework.UIButton

ButtonIcon creates an 'icon button'.

func ButtonWarningFixAction

func ButtonWarningFixAction(text string, behavior framework.ButtonBehavior) *framework.UIButton

ButtonWarningFixAction creates a 'fix XYZ' button

func InformationPanel

func InformationPanel(details InformationPanelDetails) framework.UILayoutElement

InformationPanel applies InformationPanelDetails

func LayoutDocument

func LayoutDocument(header Header, body framework.UILayoutElement, scrollable bool) framework.UILayoutElement

LayoutDocument creates a 'document' format element, with a title header & body.

func LayoutMsgbox

func LayoutMsgbox(text string, confirm func()) framework.UILayoutElement

LayoutMsgbox provides a 'message box' body layout.

func ListItem

func ListItem(details ListItemDetails) framework.UILayoutElement

ListItem sets up a list item. https://material.io/components/lists/#specs

func MarginBody

func MarginBody() frenyard.Area2i

MarginBody is the amount to push the page body by.

func NewIconPtr

func NewIconPtr(colour uint32, iconID IconID, iconSizeDP int32) framework.UILayoutElement

NewIconPtr returns a UILayoutElement for an icon at the given DP size. (Note: Only select values are supported.)

func NewUISearchBoxPtr

func NewUISearchBoxPtr(hint string, area []ListItemDetails) framework.UILayoutElement

NewUISearchBoxPtr : Given ListItemDetails, implements a box that can search through them.

func ScrollboxV

ScrollboxV sets up a fancy scrollbox with added decoration.

func Setup

func Setup(scale float64)

Setup sets the sizes, fonts and borders according to the given scale.

Types

type Header struct {
	Back framework.ButtonBehavior
	// If null, this is changed to BackIconID
	BackIcon IconID
	Title    string
	Forward  framework.ButtonBehavior
	// If null, this is changed to RunIconID
	ForwardIcon IconID
}

Header describes a 'title' header.

type IconID

type IconID int32

IconID represents a specific icon.

const BackIconID IconID = 7

BackIconID is a back arrow.

const DirectoryIconID IconID = 4

DirectoryIconID is an icon with the 'folder' style.

const DriveIconID IconID = 8

DriveIconID is a drive.

const GameIconID IconID = 3

GameIconID is an icon to represent the game.

const MenuIconID IconID = 9

MenuIconID is a sandwich.

const ModIconID IconID = 5

ModIconID is a gear.

const NullIconID IconID = 0

NullIconID should be used when no icon should be placed at all.

const RunIconID IconID = 1

RunIconID is a right-facing triangle.

const ToolIconID IconID = 6

ToolIconID is a claw hammer.

const WarningIconID IconID = 2

WarningIconID is a rounded triangle with '!' cut into it.

type InformationPanelDetails

type InformationPanelDetails struct {
	Text       string
	ActionText string
	Action     framework.ButtonBehavior
}

InformationPanelDetails tags a block of content with an icon

type ListItemDetails

type ListItemDetails struct {
	Icon IconID
	Text string
	// If you want this to occupy space (changing format) despite being empty, make it a space.
	Subtext string
	Click   framework.ButtonBehavior
}

ListItemDetails contains details for a list item.

type SortListItemDetails

type SortListItemDetails []ListItemDetails

SortListItemDetails is a sort.Interface implementation for use on ListItemDetails slices.

func (SortListItemDetails) Len

func (slid SortListItemDetails) Len() int

func (SortListItemDetails) Less

func (slid SortListItemDetails) Less(i int, j int) bool

func (SortListItemDetails) Swap

func (slid SortListItemDetails) Swap(i int, j int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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