Documentation ¶
Index ¶
- Constants
- func ApplyAsContrast(p material.Palette, pair ContrastPair) material.Palette
- func ApplyAsNormal(p material.Palette, pair ContrastPair) material.Palette
- type AuthorNameStyle
- type C
- type CommunityNameStyle
- type ContrastPair
- type D
- type IconButton
- type Rect
- type ReplyAnimationState
- type ReplyStatus
- type ReplyStyle
- type Swatch
- type TextFormStyle
- type Theme
Constants ¶
const DefaultIconButtonWidthDp = 20
Variables ¶
This section is empty.
Functions ¶
func ApplyAsContrast ¶ added in v0.0.14
func ApplyAsContrast(p material.Palette, pair ContrastPair) material.Palette
func ApplyAsNormal ¶ added in v0.0.14
func ApplyAsNormal(p material.Palette, pair ContrastPair) material.Palette
Types ¶
type AuthorNameStyle ¶ added in v0.0.6
func AuthorName ¶ added in v0.0.6
func AuthorName(theme *Theme, identity *forest.Identity, active bool) AuthorNameStyle
func (AuthorNameStyle) Layout ¶ added in v0.0.6
func (a AuthorNameStyle) Layout(gtx layout.Context) layout.Dimensions
type CommunityNameStyle ¶ added in v0.0.6
func CommunityName ¶ added in v0.0.6
func CommunityName(theme *material.Theme, community *forest.Community) CommunityNameStyle
func (CommunityNameStyle) Layout ¶ added in v0.0.6
func (a CommunityNameStyle) Layout(gtx layout.Context) layout.Dimensions
type ContrastPair ¶ added in v0.0.14
func PairFor ¶ added in v0.0.14
func PairFor(bg color.NRGBA) ContrastPair
PairFor wraps the provided theme color in a Color type with an automatically populated Text color. The Text field value is chosen based on the luminance of the provided color.
type D ¶ added in v0.0.6
type D = layout.Dimensions
type IconButton ¶ added in v0.0.10
type IconButton struct { Button *widget.Clickable Icon *widget.Icon Size unit.Value Inset layout.Inset }
IconButton applies defaults before rendering a `material.IconButtonStyle` to reduce noise. The main paramaters for each button are the state and icon. Color, size and inset are often the same. This wrapper reduces noise by defaulting those things.
type Rect ¶ added in v0.0.10
Rect 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) BorderColor ¶ added in v0.0.12
func (r ReplyStatus) BorderColor(th *Theme) color.NRGBA
func (ReplyStatus) HighlightColor ¶ added in v0.0.10
func (r ReplyStatus) HighlightColor(th *Theme) color.NRGBA
type ReplyStyle ¶
type ReplyStyle struct { *Theme Highlight color.NRGBA Background color.NRGBA TextColor color.NRGBA Border color.NRGBA // 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 // Whether or not to render the user as active ShowActive bool // contains filtered or unexported fields }
func Reply ¶
func Reply(th *Theme, status *ReplyAnimationState, nodes ds.ReplyData, showActive bool) ReplyStyle
func (ReplyStyle) HideMetadata ¶ added in v0.0.12
func (r ReplyStyle) HideMetadata(b bool) ReplyStyle
func (ReplyStyle) Layout ¶
func (r ReplyStyle) Layout(gtx layout.Context) layout.Dimensions
type Swatch ¶ added in v0.0.14
type Swatch struct {
Light, Dark, Default ContrastPair
}
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 EditorHint string EditorBackground color.NRGBA *Theme }
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
func (t TextFormStyle) Layout(gtx layout.Context) layout.Dimensions