Documentation
¶
Overview ¶
Package flow provides declarative widget wrappers for MeUi. Widgets are defined as Go structs and built into a meui.Widget tree via Build(), which works like a compile-time QML parser.
Index ¶
- func ApplyLayout(w meui.Widget, ww *W)
- func ApplyProperties(props map[string]interface{}, wrapper interface{}) error
- type BuildContext
- type Button
- type Calendar
- type CheckBox
- type CodeEditor
- type ColorField
- type ColorPicker
- type ComboBox
- type ContextMenu
- type DataTable
- type DatePicker
- type Dialog
- type DockPanel
- type GroupBox
- type HStack
- type Label
- type ListView
- type MarkdownEditor
- type MarkdownView
- type MdiContainer
- type MdiWindow
- type MenuBar
- type Panel
- type ProgressBar
- type RadioButton
- type ScrollBar
- type ScrollPane
- type Slider
- type SpinBox
- type SplitView
- type StackPanel
- type StatusBar
- type Switch
- type TabItem
- type TabPanel
- type Table
- type TextArea
- type TextField
- type TimePicker
- type ToolBar
- type ToolTip
- type Tree
- type VStack
- type W
- type WidgetWrapper
- type Window
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyLayout ¶
ApplyLayout sets layout/geometry/common properties on a widget.
func ApplyProperties ¶
ApplyProperties sets struct fields by their qml tag from a property map. wrapper must be a pointer to a struct (e.g. &Button{}). The qml tag on each field determines which property name it maps to. Properties prefixed with "anchors." or "Layout." are skipped — handled by ApplyLayout.
Types ¶
type BuildContext ¶
type BuildContext struct {
// contains filtered or unexported fields
}
BuildContext holds the registry of named widgets for reference capture.
func Build ¶
func Build(root WidgetWrapper) (meui.Widget, *BuildContext)
func NewBuildContext ¶
func NewBuildContext() *BuildContext
type Button ¶
type CheckBox ¶
type CodeEditor ¶
type CodeEditor struct {
W
Text string `qml:"text"`
Language string `qml:"language"`
ShowLineNumbers bool `qml:"showLineNumbers"`
ReadOnly bool `qml:"readOnly"`
OnCreated func(*widgets.CodeEditor) `qml:"-"`
}
func (*CodeEditor) Build ¶
func (c *CodeEditor) Build(ctx *BuildContext) meui.Widget
type ColorField ¶
type ColorField struct {
W
OnCreated func(*widgets.ColorField) `qml:"-"`
}
func (*ColorField) Build ¶
func (c *ColorField) Build(ctx *BuildContext) meui.Widget
type ColorPicker ¶
type ColorPicker struct {
W
OnCreated func(*widgets.ColorPicker) `qml:"-"`
}
func (*ColorPicker) Build ¶
func (c *ColorPicker) Build(ctx *BuildContext) meui.Widget
type ComboBox ¶
type ContextMenu ¶
type ContextMenu struct {
W
Items []widgets.MenuItem
OnCreated func(*widgets.ContextMenu) `qml:"-"`
}
func (*ContextMenu) Build ¶
func (c *ContextMenu) Build(ctx *BuildContext) meui.Widget
type DataTable ¶
type DataTable struct {
W
Columns []widgets.DataColumn
OnCreated func(*widgets.DataTable) `qml:"-"`
}
type DatePicker ¶
type DatePicker struct {
W
OnCreated func(*widgets.DatePicker) `qml:"-"`
}
func (*DatePicker) Build ¶
func (d *DatePicker) Build(ctx *BuildContext) meui.Widget
type Dialog ¶
type Dialog struct {
W
Title string `qml:"title"`
Modal bool `qml:"modal"`
OnCreated func(*widgets.ModalPopupPanel) `qml:"-"`
}
type HStack ¶
type HStack struct {
W
Spacing float32
Children []WidgetWrapper
}
type Label ¶
type ListView ¶
type MarkdownEditor ¶
type MarkdownEditor struct {
W
Text string `qml:"text"`
ReadOnly bool `qml:"readOnly"`
Mode string `qml:"mode"` // "split", "source", "preview"
SplitRatio float32 `qml:"splitRatio"` // 0..1, source share
OnCreated func(*widgets.MarkdownEditor) `qml:"-"`
OnChanged func(string) `qml:"-"`
}
MarkdownEditor is the two-pane markdown editor: a source pane and a rendered preview over the same document.
func (*MarkdownEditor) Build ¶
func (m *MarkdownEditor) Build(ctx *BuildContext) meui.Widget
type MarkdownView ¶
type MarkdownView struct {
W
Text string `qml:"text"`
OnCreated func(*widgets.MarkdownView) `qml:"-"`
}
func (*MarkdownView) Build ¶
func (m *MarkdownView) Build(ctx *BuildContext) meui.Widget
type MdiContainer ¶
type MdiContainer struct {
W
Children []WidgetWrapper
OnCreated func(*widgets.MdiContainer) `qml:"-"`
}
func (*MdiContainer) Build ¶
func (m *MdiContainer) Build(ctx *BuildContext) meui.Widget
type MdiWindow ¶
type MdiWindow struct {
W
Title string `qml:"title"`
Children []WidgetWrapper
OnCreated func(*widgets.MdiWindow) `qml:"-"`
}
type Panel ¶
type Panel struct {
W
Children []WidgetWrapper
}
type ProgressBar ¶
type ProgressBar struct {
W
Value float32 `qml:"value"`
Minimum float32 `qml:"minimum"`
Maximum float32 `qml:"maximum"`
OnCreated func(*widgets.ProgressBar) `qml:"-"`
}
func (*ProgressBar) Build ¶
func (p *ProgressBar) Build(ctx *BuildContext) meui.Widget
type RadioButton ¶
type RadioButton struct {
W
Text string `qml:"text"`
GroupID string `qml:"groupID"`
Selected bool `qml:"selected"`
OnCreated func(*widgets.RadioButton) `qml:"-"`
}
func (*RadioButton) Build ¶
func (r *RadioButton) Build(ctx *BuildContext) meui.Widget
type ScrollBar ¶
type ScrollPane ¶
type ScrollPane struct {
W
ContentWidth float32 `qml:"contentWidth"`
ContentHeight float32 `qml:"contentHeight"`
HorizontalScrollBarPolicy string `qml:"horizontalScrollBarPolicy"`
VerticalScrollBarPolicy string `qml:"verticalScrollBarPolicy"`
OnCreated func(*widgets.ScrollPane) `qml:"-"`
}
func (*ScrollPane) Build ¶
func (s *ScrollPane) Build(ctx *BuildContext) meui.Widget
type Slider ¶
type SpinBox ¶
type SplitView ¶
type StackPanel ¶
type StackPanel struct {
W
Orientation string `qml:"orientation"`
ItemSizes []float32
Children []WidgetWrapper
OnCreated func(*widgets.StackPanel) `qml:"-"`
}
func (*StackPanel) Build ¶
func (s *StackPanel) Build(ctx *BuildContext) meui.Widget
type Switch ¶
type TabPanel ¶
type Table ¶
type Table struct {
W
Columns []string `qml:"columns"`
ShowGrid bool `qml:"showGrid"`
Sortable bool `qml:"sortable"`
Resizable bool `qml:"resizable"`
Reorderable bool `qml:"reorderable"`
MultiSelect bool `qml:"multiSelect"`
Editable bool `qml:"editable"`
AlternatingRows bool `qml:"alternatingRows"`
OnCreated func(*widgets.Table) `qml:"-"`
}
type TextArea ¶
type TextField ¶
type TimePicker ¶
type TimePicker struct {
W
OnCreated func(*widgets.TimePicker) `qml:"-"`
}
func (*TimePicker) Build ¶
func (t *TimePicker) Build(ctx *BuildContext) meui.Widget
type ToolTip ¶
type Tree ¶
type VStack ¶
type VStack struct {
W
Spacing float32
Children []WidgetWrapper
}
type W ¶
type W struct {
ID string `qml:"id"`
X float32 `qml:"x"`
Y float32 `qml:"y"`
Width float32 `qml:"width"`
Height float32 `qml:"height"`
Visible bool `qml:"visible"`
Enabled bool `qml:"enabled"`
// visibleSet/enabledSet record that QML explicitly set the property —
// the Go zero value of both bools is false, but "unset" must mean
// enabled+visible (widgets default to enabled). Without the markers
// every flow widget without an explicit `enabled: true` was silently
// disabled.
VisibleSet bool `qml:"-"`
EnabledSet bool `qml:"-"`
Opacity float32 `qml:"opacity"`
// Layout properties (prefix "Layout.")
FillWidth bool `qml:"Layout.fillWidth"`
FillHeight bool `qml:"Layout.fillHeight"`
MinimumWidth float32 `qml:"Layout.minimumWidth"`
MaximumWidth float32 `qml:"Layout.maximumWidth"`
MinimumHeight float32 `qml:"Layout.minimumHeight"`
MaximumHeight float32 `qml:"Layout.maximumHeight"`
PreferredWidth float32 `qml:"Layout.preferredWidth"`
PreferredHeight float32 `qml:"Layout.preferredHeight"`
MarginLeft float32 `qml:"Layout.leftMargin"`
MarginRight float32 `qml:"Layout.rightMargin"`
MarginTop float32 `qml:"Layout.topMargin"`
MarginBottom float32 `qml:"Layout.bottomMargin"`
LayoutAlignment int `qml:"Layout.alignment"`
// Anchors (prefix "anchors.")
AnchorsFill string `qml:"anchors.fill"`
AnchorsCenterIn string `qml:"anchors.centerIn"`
AnchorLeft string `qml:"anchors.left"`
AnchorRight string `qml:"anchors.right"`
AnchorTop string `qml:"anchors.top"`
AnchorBottom string `qml:"anchors.bottom"`
AnchorHCenter string `qml:"anchors.horizontalCenter"`
AnchorVCenter string `qml:"anchors.verticalCenter"`
AnchorMargins float32 `qml:"anchors.margins"`
AnchorLeftMargin float32 `qml:"anchors.leftMargin"`
AnchorRightMargin float32 `qml:"anchors.rightMargin"`
AnchorTopMargin float32 `qml:"anchors.topMargin"`
AnchorBottomMargin float32 `qml:"anchors.bottomMargin"`
AnchorHCenterOffset float32 `qml:"anchors.horizontalCenterOffset"`
AnchorVCenterOffset float32 `qml:"anchors.verticalCenterOffset"`
}
W is the common base embedded by all flow wrappers.
type WidgetWrapper ¶
type WidgetWrapper interface {
Build(ctx *BuildContext) meui.Widget
}
WidgetWrapper is the interface implemented by all declarative wrappers.