theme

package
v0.0.10-rc3 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorNameStyle added in v0.0.6

type AuthorNameStyle struct {
	*forest.Identity
	*material.Theme
}

func AuthorName added in v0.0.6

func AuthorName(theme *material.Theme, identity *forest.Identity) AuthorNameStyle

func (AuthorNameStyle) Layout added in v0.0.6

type C added in v0.0.6

type C = layout.Context

type Colors added in v0.0.7

type Colors struct {
	Default, Light, Dark color.RGBA
}

type CommunityNameStyle added in v0.0.6

type CommunityNameStyle struct {
	*forest.Community
	*material.Theme
}

func CommunityName added in v0.0.6

func CommunityName(theme *material.Theme, community *forest.Community) CommunityNameStyle

func (CommunityNameStyle) Layout added in v0.0.6

type D added in v0.0.6

type D = layout.Dimensions

func DrawRect added in v0.0.7

func DrawRect(gtx C, background color.RGBA, size f32.Point, radii float32) D

DrawRect creates a rectangle of the provided background color with Dimensions specified by size and a corner radius (on all corners) specified by radii.

type ReplyAnimationState added in v0.0.10

type ReplyAnimationState struct {
	*anim.Normal
	Begin, End ReplyStatus
}

ReplyAnimationState holds the state of an in-progress animation for a reply. The anim.Normal field defines how far through the animation the node is, and the Begin and End fields define the two states that the node is transitioning between.

func (*ReplyAnimationState) Style added in v0.0.10

func (r *ReplyAnimationState) Style(gtx C, reply *ReplyStyle)

Style applies the appropriate visual tweaks the the reply status for the current animation frame.

type ReplyStatus added in v0.0.8

type ReplyStatus int
const (
	None ReplyStatus = iota
	Sibling
	Selected
	Ancestor
	Descendant
	ConversationRoot
)

func (ReplyStatus) HighlightColor added in v0.0.10

func (r ReplyStatus) HighlightColor(th *Theme) color.RGBA

type ReplyStyle

type ReplyStyle struct {
	*Theme
	Highlight  color.RGBA
	Background color.RGBA
	TextColor  color.RGBA
	// MaxLines limits the maximum number of lines of content text that should
	// be displayed. Values less than 1 indicate unlimited.
	MaxLines int

	// CollapseMetadata should be set to true if this reply can be rendered
	// without the author being displayed.
	CollapseMetadata bool

	*ReplyAnimationState

	ds.ReplyData
	// contains filtered or unexported fields
}

func Reply

func Reply(th *Theme, status *ReplyAnimationState, nodes ds.ReplyData) ReplyStyle

func (ReplyStyle) Layout

func (r ReplyStyle) Layout(gtx layout.Context) layout.Dimensions

type TextFormStyle added in v0.0.9

type TextFormStyle struct {
	State *widget.TextForm
	// internal widget separation distance
	layout.Inset
	PasteButton  material.IconButtonStyle
	SubmitButton material.ButtonStyle
	material.EditorStyle
	EditorBackground color.RGBA
}

func TextForm added in v0.0.9

func TextForm(th *Theme, state *widget.TextForm, submitText, formHint string) TextFormStyle

func (TextFormStyle) Layout added in v0.0.9

type Theme added in v0.0.7

type Theme struct {
	*material.Theme
	Primary    Colors
	Secondary  Colors
	Background Colors

	Ancestors, Descendants, Selected, Siblings, Unselected *color.RGBA
}

func New added in v0.0.7

func New() *Theme

Jump to

Keyboard shortcuts

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