Documentation ¶
Index ¶
- Constants
- Variables
- func BorderTitle(colour uint32) framework.Frame
- func ButtonAction(colour uint32, text string, behavior framework.ButtonBehavior) *framework.UIButton
- func ButtonBar(buttons []framework.UILayoutElement) framework.UILayoutElement
- func ButtonIcon(icon IconID, dp int32, click framework.ButtonBehavior) *framework.UIButton
- func ButtonWarningFixAction(text string, behavior framework.ButtonBehavior) *framework.UIButton
- func InformationPanel(details InformationPanelDetails) framework.UILayoutElement
- func LayoutDocument(header Header, body framework.UILayoutElement, scrollable bool) framework.UILayoutElement
- func LayoutMsgbox(text string, confirm func()) framework.UILayoutElement
- func ListItem(details ListItemDetails) framework.UILayoutElement
- func MarginBody() frenyard.Area2i
- func NewIconPtr(colour uint32, iconID IconID, iconSizeDP int32) framework.UILayoutElement
- func NewUISearchBoxPtr(hint string, area []ListItemDetails) framework.UILayoutElement
- func ScrollboxV(inwards framework.UILayoutElement) framework.UILayoutElement
- func Setup(scale float64)
- type Header
- type IconID
- type InformationPanelDetails
- type ListItemDetails
- type SortListItemDetails
Constants ¶
const ThemeBackground uint32 = 0xFF202020
ThemeBackground is the colour for most page content.
const ThemeBackgroundSearch uint32 = 0xFF101010
ThemeBackgroundSearch is the colour for searchboxbackground
const ThemeBackgroundTitle uint32 = 0xFF404040
ThemeBackgroundTitle is the colour for the page title background.
const ThemeBackgroundUnderlayer uint32 = 0xFF101010
ThemeBackgroundUnderlayer is the colour for backgrounds in "underground" lists.
const ThemeBackgroundWarning uint32 = 0xFFFFA000
ThemeBackgroundWarning is the colour for warning backgrounds.
const ThemeImpossibleActionButton uint32 = 0xFF404040
ThemeImpossibleActionButton is the colour for buttons that fail, but will explain why it is impossible.
const ThemeOkActionButton uint32 = 0xFF2040FF
ThemeOkActionButton is the colour for OK or Install buttons.
const ThemePlaceholder uint32 = 0xFFFF0000
ThemePlaceholder is the colour for placeholders.
const ThemeRemoveActionButton uint32 = 0xFFB11E1E
ThemeRemoveActionButton is the colour for Remove buttons.
const ThemeSubText uint32 = 0xFFC0C0C0
ThemeSubText is for 'detail' text that doesn't matter that much.
const ThemeText uint32 = 0xFFFFFFFF
ThemeText is the colour for most text.
const ThemeTextInputHint = 0xFF808080
ThemeTextInputHint is the colour for text hints
const ThemeTextInputSuggestion = 0xFF80FF80
ThemeTextInputSuggestion is the colour for text input suggestions.
const ThemeTextWarning uint32 = 0xFF000000
ThemeTextWarning is the colour for warning text.
const ThemeUpdateActionButton uint32 = 0xFFD28C44
ThemeUpdateActionButton is the colour for Update buttons.
Variables ¶
var ButtonTextFont font.Face
ButtonTextFont for buttons
var DesignScale float64
DesignScale is the current scale for the Design.
var GlobalFont font.Face
GlobalFont for most text
var ListItemSubTextFont font.Face
ListItemSubTextFont for undertext
var ListItemTextFont font.Face
ListItemTextFont for main list item text
var PageTitleFont font.Face
PageTitleFont for a page title
var ScrollbarThemeH framework.ScrollbarTheme
ScrollbarThemeH is the ScrollbarTheme for horizontal scrollbars.
var ScrollbarThemeV framework.ScrollbarTheme
ScrollbarThemeV is the ScrollbarTheme for vertical scrollbars.
var ScrollboxExterior framework.NinePatchFrame
ScrollboxExterior should be wrapped around scrollboxen.
var SizeMarginAroundEverything int32
SizeMarginAroundEverything is a useful margin around the body, etc.
var SizeTextNudge int32
SizeTextNudge is the amount to nudge text vertically downwards to make it seem even.
var SizeWindow frenyard.Vec2i
SizeWindow is the size of the main window.
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 ¶
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 ¶
func ButtonBar(buttons []framework.UILayoutElement) framework.UILayoutElement
ButtonBar provides a 'button-bar' to put at the bottom of dialogs.
func ButtonIcon ¶
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 ¶
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 ¶
func ScrollboxV(inwards framework.UILayoutElement) framework.UILayoutElement
ScrollboxV sets up a fancy scrollbox with added decoration.
Types ¶
type Header ¶
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) Swap ¶
func (slid SortListItemDetails) Swap(i int, j int)