Documentation
¶
Overview ¶
SPDX-License-Identifier: Unlicense OR MIT
SPDX-License-Identifier: Unlicense OR MIT Copied from: gioui material/radiobutton.go with some modifications
Index ¶
- Constants
- Variables
- func Clickable(gtx layout.Context, button *widget.Clickable, cornerRadius unit.Dp, ...) layout.Dimensions
- func Disabled(c color.NRGBA) (d color.NRGBA)
- func DrawLine(gtx layout.Context, background color.NRGBA, height, width unit.Dp) layout.Dimensions
- func DrawLineFlex(background color.NRGBA, height, width unit.Dp) layout.FlexChild
- func DrawRect(gtx layout.Context, background color.NRGBA, size f32.Point, radii float32) layout.Dimensions
- func Hovered(c color.NRGBA) (h color.NRGBA)
- func MaterialIcons(name string, theme *chapartheme.Theme) material.LabelStyle
- func MulAlpha(c color.NRGBA, alpha uint8) color.NRGBA
- func SaveButtonLayout(gtx layout.Context, theme *chapartheme.Theme, clickable *widget.Clickable) layout.Dimensions
- func WithAlpha(c color.NRGBA, a uint8) color.NRGBA
- type BadgeInput
- type BadgeInputItem
- type ButtonLayoutStyle
- type ButtonStyle
- type CheckBoxStyle
- type ContextArea
- func (r *ContextArea) Activated() bool
- func (r *ContextArea) Active() bool
- func (r *ContextArea) Dismiss()
- func (r *ContextArea) Dismissed() bool
- func (r *ContextArea) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions
- func (r *ContextArea) Show()
- func (r *ContextArea) Update(gtx layout.Context)
- type DividerStyle
- type DropDown
- func (c *DropDown) Changed() bool
- func (c *DropDown) GetSelected() *DropDownOption
- func (c *DropDown) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
- func (c *DropDown) SelectedIndex() int
- func (c *DropDown) SetOnChanged(f func(value string))
- func (c *DropDown) SetOptions(options ...*DropDownOption)
- func (c *DropDown) SetSelected(index int)
- func (c *DropDown) SetSelectedByIdentifier(identifier string)
- func (c *DropDown) SetSelectedByTitle(title string)
- func (c *DropDown) SetSelectedByValue(value string)
- func (c *DropDown) SetSize(size image.Point)
- type DropDownOption
- func (o *DropDownOption) DefaultSelected() *DropDownOption
- func (o *DropDownOption) GetText() string
- func (o *DropDownOption) GetValue() string
- func (o *DropDownOption) WithIcon(icon *widget.Icon, color color.NRGBA, size unit.Dp) *DropDownOption
- func (o *DropDownOption) WithIdentifier(identifier string) *DropDownOption
- func (o *DropDownOption) WithValue(value string) *DropDownOption
- type EditableLabel
- type FileSelector
- func (b *FileSelector) Changed() bool
- func (b *FileSelector) GetFilePath() string
- func (b *FileSelector) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
- func (b *FileSelector) RemoveFile()
- func (b *FileSelector) SetExplorer(explorer *explorer.Explorer)
- func (b *FileSelector) SetFileName(name string)
- func (b *FileSelector) SetOnChanged(f func(filePath string))
- func (b *FileSelector) SetOnSelectFile(f func())
- type FlatButton
- type FocusBorderStyle
- type Icon
- type IconButton
- type IconButtonStyle
- type ImageButton
- type JsonViewer
- type KeyValue
- func (kv *KeyValue) AddItem(item *KeyValueItem)
- func (kv *KeyValue) Filter(text string)
- func (kv *KeyValue) GetItems() []*KeyValueItem
- func (kv *KeyValue) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
- func (kv *KeyValue) SetItems(items []*KeyValueItem)
- func (kv *KeyValue) SetOnChanged(onChanged func(items []*KeyValueItem))
- func (kv *KeyValue) SetReadOnly(readonly bool)
- func (kv *KeyValue) WithAddLayout(gtx layout.Context, title, hint string, theme *chapartheme.Theme) layout.Dimensions
- type KeyValueItem
- type LabeledInput
- func (l *LabeledInput) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
- func (l *LabeledInput) SetHint(hint string)
- func (l *LabeledInput) SetLabel(label string)
- func (l *LabeledInput) SetOnChanged(f func(text string))
- func (l *LabeledInput) SetText(text string)
- func (l *LabeledInput) Text() string
- type NumericEditor
- type Option
- type PatternEditor
- func (p *PatternEditor) Layout(gtx layout.Context, theme *chapartheme.Theme, hint string) layout.Dimensions
- func (p *PatternEditor) SetOnChanged(onChange func(text string))
- func (p *PatternEditor) SetOnSubmit(onSubmit func())
- func (p *PatternEditor) SetText(text string)
- func (p *PatternEditor) UpdateStyles()
- type Prompt
- func (p *Prompt) Hide()
- func (p *Prompt) IsVisible() bool
- func (p *Prompt) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
- func (p *Prompt) Result() (string, bool)
- func (p *Prompt) SetOnSubmit(f func(selectedOption string, remember bool))
- func (p *Prompt) SetOptions(options ...Option)
- func (p *Prompt) Show()
- func (p *Prompt) WithRememberBool()
- func (p *Prompt) WithoutRememberBool()
- type RadioButtonStyle
- type Rect
- type SettingItem
- func NewBoolItem(title, key, description string, value bool) *SettingItem
- func NewDropDownItem(title, key, description, value string, options ...*DropDownOption) *SettingItem
- func NewFileItem(explorer *explorer.Explorer, title, key, description string, value string, ...) *SettingItem
- func NewHeaderItem(title string) *SettingItem
- func NewNumberItem(title, key, description string, value int) *SettingItem
- func NewTextItem(title, key, description string, value string) *SettingItem
- func (i *SettingItem) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
- func (i *SettingItem) MinWidth(w unit.Dp) *SettingItem
- func (i *SettingItem) SetVisibleWhen(f func(values map[string]any) bool) *SettingItem
- func (i *SettingItem) TextAlignment(a text.Alignment) *SettingItem
- func (i *SettingItem) WithDefaultValue(value any) *SettingItem
- type Settings
- type SplitView
- type SvgIcon
- type Tab
- type Tabs
- func (tabs *Tabs) AddTab(tab *Tab) int
- func (tabs *Tabs) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
- func (tabs *Tabs) RemoveTabByID(id string)
- func (tabs *Tabs) Selected() int
- func (tabs *Tabs) SelectedTab() *Tab
- func (tabs *Tabs) SetMaxTitleWidth(maxWidth int)
- func (tabs *Tabs) SetSelected(index int)
- func (tabs *Tabs) SetSelectedByID(id string)
- func (tabs *Tabs) SetTabs(items []*Tab)
- type TextField
- func (t *TextField) GetText() string
- func (t *TextField) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
- func (t *TextField) SetBorderColor(color color.NRGBA)
- func (t *TextField) SetIcon(icon *widget.Icon, position int)
- func (t *TextField) SetMinWidth(width int)
- func (t *TextField) SetOnIconClick(f func())
- func (t *TextField) SetOnTextChange(f func(text string))
- func (t *TextField) SetSize(s image.Point)
- func (t *TextField) SetText(text string)
- type TreeNode
- type TreeView
- func (t *TreeView) AddChildNode(parentIdentifier string, child *TreeNode)
- func (t *TreeView) AddNode(node *TreeNode)
- func (t *TreeView) ExpandNode(identifier string)
- func (t *TreeView) Filter(text string)
- func (t *TreeView) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
- func (t *TreeView) LayoutTreeNode(gtx layout.Context, theme *chapartheme.Theme, node *TreeNode) layout.Dimensions
- func (t *TreeView) OnNodeClick(fn func(tr *TreeNode))
- func (t *TreeView) OnNodeDoubleClick(fn func(tr *TreeNode))
- func (t *TreeView) RemoveNode(identifier string)
- func (t *TreeView) SetNodes(nodes []*TreeNode)
- func (t *TreeView) SetOnMenuItemClick(fn func(tr *TreeNode, item string))
- func (t *TreeView) SetSelectedOnClick(i bool)
Constants ¶
const ( FlatButtonIconStart = 0 FlatButtonIconEnd = 1 FlatButtonIconTop = 2 FlatButtonIconDown = 3 )
const ( ModalTypeInfo = "info" ModalTypeWarn = "warn" ModalTypeErr = "err" )
Prompt is a modal dialog that prompts the user for a response.
const ( ItemTypeText = "text" ItemTypeFile = "file" ItemTypeBool = "bool" ItemTypeNumber = "number" ItemTypeDropDown = "dropdown" ItemTypeHeader = "header" )
const ( IconPositionStart = 0 IconPositionEnd = 1 )
Variables ¶
var ArrowDropDownIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.NavigationArrowDropDown) return icon }()
var CircleIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.ImageLens) return icon }()
var CleanIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.CommunicationClearAll) return icon }()
var CloseIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.NavigationClose) return icon }()
var CodeIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.ActionCode) return icon }()
var ConsoleIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.HardwareDesktopMac) return icon }()
var CopyIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.ContentContentCopy) return icon }()
var DarkIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.ActionSubject) return icon }()
var DeleteIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.ActionDelete) return icon }()
var EditIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.ContentCreate) return icon }()
var ErrorIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.AlertError) return icon }()
var ExpandIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.NavigationExpandMore) return icon }()
var FileFolderIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.FileFolder) return icon }()
var ForwardIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.NavigationChevronRight) return icon }()
var HeartIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.ActionFavorite) return icon }()
var HomeIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.ActionHome) return icon }()
var InfoIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.ActionInfo) return icon }()
var LogsIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.ActionSubject) return icon }()
var MenuIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.NavigationMenu) return icon }()
var MoreVertIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.NavigationMoreVert) return icon }()
var Notifications *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.SocialNotifications) return icon }()
var OtherIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.ActionHelp) return icon }()
var PlusIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.ContentAdd) return icon }()
var RefreshIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.NavigationRefresh) return icon }()
var SaveIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.ContentSave) return icon }()
var SearchIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.ActionSearch) return icon }()
var SendIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.ContentSend) return icon }()
var SettingsIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.ActionSettings) return icon }()
var SwapHoriz *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.ActionSwapHoriz) return icon }()
var TunnelIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.ActionSwapVerticalCircle) return icon }()
var UploadIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.FileFileUpload) return icon }()
var VisibilityIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.ActionVisibility) return icon }()
var WarningIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.AlertWarning) return icon }()
var WorkspacesIcon *widget.Icon = func() *widget.Icon { icon, _ := widget.NewIcon(icons.NavigationApps) return icon }()
Functions ¶
func Clickable ¶
func Clickable(gtx layout.Context, button *widget.Clickable, cornerRadius unit.Dp, w layout.Widget) layout.Dimensions
Clickable lays out a rectangular clickable widget without further decoration.
func Disabled ¶
Disabled blends color towards the luminance and multiplies alpha. Blending towards luminance will desaturate the color. Multiplying alpha blends the color together more with the background.
func DrawLineFlex ¶
func DrawRect ¶
func DrawRect(gtx layout.Context, background color.NRGBA, size f32.Point, radii float32) layout.Dimensions
DrawRect creates a rectangle of the provided background color with Dimensions specified by size and a corner radius (on all corners) specified by radii.
func Hovered ¶
Hovered blends dark colors towards white, and light colors towards black. It is approximate because it operates in non-linear sRGB space.
func MaterialIcons ¶
func MaterialIcons(name string, theme *chapartheme.Theme) material.LabelStyle
func SaveButtonLayout ¶
func SaveButtonLayout(gtx layout.Context, theme *chapartheme.Theme, clickable *widget.Clickable) layout.Dimensions
Types ¶
type BadgeInput ¶
type BadgeInput struct {
Items []*BadgeInputItem
// contains filtered or unexported fields
}
func NewBadgeInput ¶
func NewBadgeInput(items ...*BadgeInputItem) *BadgeInput
func (*BadgeInput) AddItem ¶
func (b *BadgeInput) AddItem(identifier, value string)
func (*BadgeInput) GetValues ¶
func (b *BadgeInput) GetValues() map[string]string
func (*BadgeInput) Layout ¶
func (b *BadgeInput) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
func (*BadgeInput) SetOnChange ¶
func (b *BadgeInput) SetOnChange(f func(values map[string]string))
type BadgeInputItem ¶
type ButtonLayoutStyle ¶
type ButtonLayoutStyle struct {
Background color.NRGBA
CornerRadius unit.Dp
Button *widget.Clickable
}
func (ButtonLayoutStyle) Layout ¶
func (b ButtonLayoutStyle) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions
type ButtonStyle ¶
type ButtonStyle struct {
Text string
Icon Icon
IconPosition int
// Color is the text color.
Color color.NRGBA
Font font.Font
TextSize unit.Sp
Background color.NRGBA
CornerRadius unit.Dp
Inset layout.Inset
Button *widget.Clickable
IconSize unit.Sp
IconInset layout.Inset
// contains filtered or unexported fields
}
func (ButtonStyle) Layout ¶
func (b ButtonStyle) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
type CheckBoxStyle ¶
func (CheckBoxStyle) Layout ¶
func (c CheckBoxStyle) Layout(gtx layout.Context) layout.Dimensions
Layout updates the checkBox and displays it.
type ContextArea ¶ added in v0.3.4
type ContextArea struct {
// Activation is the pointer Buttons within the context area
// that trigger the presentation of the contextual widget. If this
// is zero, it will default to pointer.ButtonSecondary.
Activation pointer.Buttons
// AbsolutePosition will position the contextual widget in the
// relative to the position of the context area instead of relative
// to the position of the click event that triggered the activation.
// This is useful for controls (like button-activated menus) where
// the contextual content should not be precisely attached to the
// click position, but should instead be attached to the button.
AbsolutePosition bool
// PositionHint tells the ContextArea the closest edge/corner of the
// window to where it is being used in the layout. This helps it to
// position the contextual widget without it overflowing the edge of
// the window.
PositionHint layout.Direction
// contains filtered or unexported fields
}
ContextArea is a region of the UI that responds to certain pointer events by displaying a contextual widget. The contextual widget is overlaid using an op.DeferOp. The contextual widget can be dismissed by primary-clicking within or outside of it.
func (*ContextArea) Activated ¶ added in v0.3.4
func (r *ContextArea) Activated() bool
Activated returns true if the context area has become active since the last call to Activated.
func (*ContextArea) Active ¶ added in v0.3.4
func (r *ContextArea) Active() bool
Active returns whether the ContextArea is currently active (whether it is currently displaying overlaid content or not).
func (*ContextArea) Dismiss ¶ added in v0.3.4
func (r *ContextArea) Dismiss()
Dismiss sets the ContextArea to not be active.
func (*ContextArea) Dismissed ¶ added in v0.3.4
func (r *ContextArea) Dismissed() bool
Dismissed returns true if the context area has been dismissed since the last call to Dismissed.
func (*ContextArea) Layout ¶ added in v0.3.4
func (r *ContextArea) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions
Layout renders the context area and -- if the area is activated by an appropriate gesture -- also the provided widget overlaid using an op.DeferOp.
func (*ContextArea) Show ¶ added in v0.3.4
func (r *ContextArea) Show()
func (*ContextArea) Update ¶ added in v0.3.4
func (r *ContextArea) Update(gtx layout.Context)
Update performs event processing for the context area but does not lay it out. It is automatically invoked by Layout() if it has not already been called during a given frame.
type DividerStyle ¶ added in v0.4.1
func (*DividerStyle) Layout ¶ added in v0.4.1
func (d *DividerStyle) Layout(gtx layout.Context, th *chapartheme.Theme) layout.Dimensions
type DropDown ¶
type DropDown struct {
MinWidth unit.Dp
MaxWidth unit.Dp
// contains filtered or unexported fields
}
func NewDropDown ¶
func NewDropDown(options ...*DropDownOption) *DropDown
func NewDropDownWithoutBorder ¶
func NewDropDownWithoutBorder(options ...*DropDownOption) *DropDown
func (*DropDown) GetSelected ¶
func (c *DropDown) GetSelected() *DropDownOption
func (*DropDown) Layout ¶
func (c *DropDown) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
Layout the DropDown.
func (*DropDown) SelectedIndex ¶
func (*DropDown) SetOnChanged ¶
func (*DropDown) SetOptions ¶
func (c *DropDown) SetOptions(options ...*DropDownOption)
func (*DropDown) SetSelected ¶
func (*DropDown) SetSelectedByIdentifier ¶
func (*DropDown) SetSelectedByTitle ¶
func (*DropDown) SetSelectedByValue ¶
type DropDownOption ¶
type DropDownOption struct {
Text string
Value string
Identifier string
Icon *widget.Icon
IconColor color.NRGBA
IconSize unit.Dp
// contains filtered or unexported fields
}
func NewDropDownDivider ¶
func NewDropDownDivider() *DropDownOption
func NewDropDownOption ¶
func NewDropDownOption(text string) *DropDownOption
func (*DropDownOption) DefaultSelected ¶
func (o *DropDownOption) DefaultSelected() *DropDownOption
func (*DropDownOption) GetText ¶
func (o *DropDownOption) GetText() string
func (*DropDownOption) GetValue ¶
func (o *DropDownOption) GetValue() string
func (*DropDownOption) WithIcon ¶
func (o *DropDownOption) WithIcon(icon *widget.Icon, color color.NRGBA, size unit.Dp) *DropDownOption
func (*DropDownOption) WithIdentifier ¶
func (o *DropDownOption) WithIdentifier(identifier string) *DropDownOption
func (*DropDownOption) WithValue ¶
func (o *DropDownOption) WithValue(value string) *DropDownOption
type EditableLabel ¶
type EditableLabel struct {
Text string
// contains filtered or unexported fields
}
func NewEditableLabel ¶
func NewEditableLabel(text string) *EditableLabel
func (*EditableLabel) Layout ¶
func (e *EditableLabel) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
func (*EditableLabel) SetEditing ¶
func (e *EditableLabel) SetEditing(editing bool)
func (*EditableLabel) SetOnChanged ¶
func (e *EditableLabel) SetOnChanged(f func(text string))
func (*EditableLabel) SetReadOnly ¶
func (e *EditableLabel) SetReadOnly(readOnly bool)
func (*EditableLabel) SetText ¶
func (e *EditableLabel) SetText(text string)
type FileSelector ¶
type FileSelector struct {
FileName string
// contains filtered or unexported fields
}
FileSelector is a widget that allows the user to select a file. it handles the file selection and display the file name.
func NewFileSelector ¶
func NewFileSelector(filename string, explorer *explorer.Explorer, extensions ...string) *FileSelector
func (*FileSelector) Changed ¶
func (b *FileSelector) Changed() bool
func (*FileSelector) GetFilePath ¶
func (b *FileSelector) GetFilePath() string
func (*FileSelector) Layout ¶
func (b *FileSelector) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
func (*FileSelector) RemoveFile ¶
func (b *FileSelector) RemoveFile()
func (*FileSelector) SetExplorer ¶
func (b *FileSelector) SetExplorer(explorer *explorer.Explorer)
func (*FileSelector) SetFileName ¶
func (b *FileSelector) SetFileName(name string)
func (*FileSelector) SetOnChanged ¶ added in v0.2.5
func (b *FileSelector) SetOnChanged(f func(filePath string))
func (*FileSelector) SetOnSelectFile ¶
func (b *FileSelector) SetOnSelectFile(f func())
type FlatButton ¶
type FlatButton struct {
Icon *widget.Icon
IconPosition int
SpaceBetween unit.Dp
Clickable *widget.Clickable
MinWidth unit.Dp
BackgroundColor color.NRGBA
TextColor color.NRGBA
Text string
CornerRadius int
BackgroundPadding unit.Dp
ContentPadding unit.Dp
}
func (*FlatButton) Layout ¶
func (f *FlatButton) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
type FocusBorderStyle ¶
FocusBorderStyle implements styling of a focused widget.
func FocusBorder ¶
func FocusBorder(th *material.Theme, focused bool) FocusBorderStyle
FocusBorder creates a focus border for a focused widget.
func (FocusBorderStyle) Layout ¶
func (focus FocusBorderStyle) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions
Layout adds a focus border and styling.
type IconButton ¶
type IconButton struct {
Icon *widget.Icon
Size unit.Dp
Color color.NRGBA
BackgroundColor color.NRGBA
BackgroundColorHover color.NRGBA
SkipFocus bool
Clickable *widget.Clickable
OnClick func()
}
func (*IconButton) Layout ¶
func (ib *IconButton) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
type IconButtonStyle ¶
type ImageButton ¶ added in v0.4.2
func NewImageButton ¶ added in v0.4.2
func NewImageButton(image paint.ImageOp, title string) *ImageButton
func (*ImageButton) Layout ¶ added in v0.4.2
func (b *ImageButton) Layout(gtx layout.Context, th *chapartheme.Theme) layout.Dimensions
type JsonViewer ¶
type JsonViewer struct {
// contains filtered or unexported fields
}
func NewJsonViewer ¶
func NewJsonViewer() *JsonViewer
func (*JsonViewer) Layout ¶
func (j *JsonViewer) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
func (*JsonViewer) SetData ¶
func (j *JsonViewer) SetData(data string)
type KeyValue ¶
type KeyValue struct {
Items []*KeyValueItem
// contains filtered or unexported fields
}
func NewKeyValue ¶
func NewKeyValue(items ...*KeyValueItem) *KeyValue
func (*KeyValue) AddItem ¶
func (kv *KeyValue) AddItem(item *KeyValueItem)
func (*KeyValue) GetItems ¶
func (kv *KeyValue) GetItems() []*KeyValueItem
func (*KeyValue) Layout ¶
func (kv *KeyValue) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
func (*KeyValue) SetItems ¶
func (kv *KeyValue) SetItems(items []*KeyValueItem)
func (*KeyValue) SetOnChanged ¶
func (kv *KeyValue) SetOnChanged(onChanged func(items []*KeyValueItem))
func (*KeyValue) SetReadOnly ¶ added in v0.4.6
func (*KeyValue) WithAddLayout ¶
func (kv *KeyValue) WithAddLayout(gtx layout.Context, title, hint string, theme *chapartheme.Theme) layout.Dimensions
type KeyValueItem ¶
type KeyValueItem struct {
Identifier string
Key string
Value string
Active bool
// contains filtered or unexported fields
}
func NewKeyValueItem ¶
func NewKeyValueItem(key, value, identifier string, active bool) *KeyValueItem
type LabeledInput ¶
type LabeledInput struct {
Label string
SpaceBetween int
MinEditorWidth unit.Dp
MinLabelWidth unit.Dp
Editor *PatternEditor
Hint string
}
func (*LabeledInput) Layout ¶
func (l *LabeledInput) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
func (*LabeledInput) SetHint ¶ added in v0.2.4
func (l *LabeledInput) SetHint(hint string)
func (*LabeledInput) SetLabel ¶ added in v0.2.4
func (l *LabeledInput) SetLabel(label string)
func (*LabeledInput) SetOnChanged ¶ added in v0.2.4
func (l *LabeledInput) SetOnChanged(f func(text string))
func (*LabeledInput) SetText ¶ added in v0.2.4
func (l *LabeledInput) SetText(text string)
func (*LabeledInput) Text ¶ added in v0.2.4
func (l *LabeledInput) Text() string
type NumericEditor ¶ added in v0.3.4
func (*NumericEditor) Layout ¶ added in v0.3.4
func (n *NumericEditor) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
func (*NumericEditor) Value ¶ added in v0.3.4
func (n *NumericEditor) Value() int
type PatternEditor ¶ added in v0.2.4
type PatternEditor struct {
*giovieweditor.Editor
Keys map[string]string
// contains filtered or unexported fields
}
PatternEditor is a widget that allows the user to edit a text like and highlight patterns like {{id}} or {name}
func NewPatternEditor ¶ added in v0.2.4
func NewPatternEditor() *PatternEditor
NewPatternEditor creates a new PatternEditor
func (*PatternEditor) Layout ¶ added in v0.2.4
func (p *PatternEditor) Layout(gtx layout.Context, theme *chapartheme.Theme, hint string) layout.Dimensions
func (*PatternEditor) SetOnChanged ¶ added in v0.2.4
func (p *PatternEditor) SetOnChanged(onChange func(text string))
func (*PatternEditor) SetOnSubmit ¶ added in v0.2.4
func (p *PatternEditor) SetOnSubmit(onSubmit func())
func (*PatternEditor) SetText ¶ added in v0.2.4
func (p *PatternEditor) SetText(text string)
func (*PatternEditor) UpdateStyles ¶ added in v0.2.4
func (p *PatternEditor) UpdateStyles()
type Prompt ¶
type Prompt struct {
Title string
Content string
Type string
Visible bool
// contains filtered or unexported fields
}
func (*Prompt) Layout ¶
func (p *Prompt) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
func (*Prompt) SetOnSubmit ¶
func (*Prompt) SetOptions ¶
func (*Prompt) WithRememberBool ¶
func (p *Prompt) WithRememberBool()
func (*Prompt) WithoutRememberBool ¶
func (p *Prompt) WithoutRememberBool()
type RadioButtonStyle ¶
type RadioButtonStyle struct {
Key string
Group *widget.Enum
// contains filtered or unexported fields
}
func RadioButton ¶
RadioButton returns a RadioButton with a label. The key specifies the value for the Enum.
func (RadioButtonStyle) Layout ¶
func (r RadioButtonStyle) Layout(gtx layout.Context) layout.Dimensions
Layout updates enum and displays the radio button.
type Rect ¶
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 SettingItem ¶
type SettingItem struct {
Title string
Key string
Description string
Type string
Value any
Default any
FileSelector *FileSelector
// contains filtered or unexported fields
}
func NewBoolItem ¶
func NewBoolItem(title, key, description string, value bool) *SettingItem
func NewDropDownItem ¶ added in v0.4.1
func NewDropDownItem(title, key, description, value string, options ...*DropDownOption) *SettingItem
func NewFileItem ¶
func NewHeaderItem ¶ added in v0.4.1
func NewHeaderItem(title string) *SettingItem
func NewNumberItem ¶
func NewNumberItem(title, key, description string, value int) *SettingItem
func NewTextItem ¶
func NewTextItem(title, key, description string, value string) *SettingItem
func (*SettingItem) Layout ¶
func (i *SettingItem) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
func (*SettingItem) MinWidth ¶ added in v0.4.1
func (i *SettingItem) MinWidth(w unit.Dp) *SettingItem
func (*SettingItem) SetVisibleWhen ¶
func (i *SettingItem) SetVisibleWhen(f func(values map[string]any) bool) *SettingItem
func (*SettingItem) TextAlignment ¶ added in v0.4.1
func (i *SettingItem) TextAlignment(a text.Alignment) *SettingItem
func (*SettingItem) WithDefaultValue ¶ added in v0.4.1
func (i *SettingItem) WithDefaultValue(value any) *SettingItem
type Settings ¶
type Settings struct {
Items []*SettingItem
// contains filtered or unexported fields
}
func NewSettings ¶
func NewSettings(items []*SettingItem) *Settings
func (*Settings) Layout ¶
func (s *Settings) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
func (*Settings) SetOnChange ¶
type SplitView ¶
type SvgIcon ¶ added in v0.4.5
type SvgIcon struct {
// contains filtered or unexported fields
}
var CollectionIcon *SvgIcon = loadSvgIcon("collection")
var FormatIcon *SvgIcon = loadSvgIcon("format")
var GRPCIcon *SvgIcon = loadSvgIcon("grpc")
var GraphQLIcon *SvgIcon = loadSvgIcon("graphql")
var HTTPIcon *SvgIcon = loadSvgIcon("http")
var HorizontalSplitIcon *SvgIcon = loadSvgIcon("splitscreen_h")
var TerminalIcon *SvgIcon = loadSvgIcon("terminal")
var VerticalSplitIcon *SvgIcon = loadSvgIcon("splitscreen_v")
type Tab ¶
type Tab struct {
Title string
Identifier string
Closable bool
CloseClickable *widget.Clickable
Meta *safemap.Map[string]
// contains filtered or unexported fields
}
func (*Tab) GetIdentifier ¶
func (*Tab) IsDataChanged ¶
func (*Tab) SetDataChanged ¶
func (*Tab) SetIdentifier ¶
func (*Tab) SetOnClose ¶
type Tabs ¶
type Tabs struct {
// contains filtered or unexported fields
}
func (*Tabs) Layout ¶
func (tabs *Tabs) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
func (*Tabs) RemoveTabByID ¶
func (*Tabs) SelectedTab ¶
func (*Tabs) SetMaxTitleWidth ¶
func (*Tabs) SetSelected ¶
func (*Tabs) SetSelectedByID ¶
type TextField ¶
type TextField struct {
Icon *widget.Icon
IconPosition int
BorderColor color.NRGBA
BorderColorFocused color.NRGBA
Text string
Placeholder string
// contains filtered or unexported fields
}
func NewTextField ¶
func (*TextField) Layout ¶
func (t *TextField) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
func (*TextField) SetBorderColor ¶
func (*TextField) SetMinWidth ¶
func (*TextField) SetOnIconClick ¶
func (t *TextField) SetOnIconClick(f func())
func (*TextField) SetOnTextChange ¶
type TreeNode ¶
type TreeNode struct {
Text string
Prefix string
PrefixColor color.NRGBA
Identifier string
Children []*TreeNode
DiscloserState component.DiscloserState
MenuOptions []string
IsSelected bool
Meta *safemap.Map[string]
// contains filtered or unexported fields
}
func (*TreeNode) AddChildNode ¶
func (*TreeNode) SetIdentifier ¶
type TreeView ¶
type TreeView struct {
// contains filtered or unexported fields
}
func NewTreeView ¶
func (*TreeView) AddChildNode ¶
func (*TreeView) ExpandNode ¶
func (*TreeView) Layout ¶
func (t *TreeView) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
func (*TreeView) LayoutTreeNode ¶
func (t *TreeView) LayoutTreeNode(gtx layout.Context, theme *chapartheme.Theme, node *TreeNode) layout.Dimensions
LayoutTreeNode recursively lays out a tree of widgets described by TreeNodes.
func (*TreeView) OnNodeClick ¶
func (*TreeView) OnNodeDoubleClick ¶
func (*TreeView) RemoveNode ¶
func (*TreeView) SetOnMenuItemClick ¶
func (*TreeView) SetSelectedOnClick ¶ added in v0.4.1
Source Files
¶
- badge_input.go
- btn.go
- checkable.go
- checkbox.go
- clickable.go
- color.go
- context_area.go
- divider.go
- dropdown.go
- editable_label.go
- file_selector.go
- flat_button.go
- focus.go
- icon_button.go
- icons.go
- image_btn.go
- jsonviewer.go
- keyvalue.go
- labeled_input.go
- line.go
- numeric_editor.go
- pattern_editor.go
- prompt.go
- radiobutton.go
- rect.go
- save_btn.go
- settings.go
- splitview.go
- tab.go
- textfield.go
- treeview.go