Documentation
¶
Overview ¶
Package container provides containers that are used to lay out and organise applications.
Index ¶
- Constants
- func New(layout core.Layout, objects ...core.CanvasObject) *bellui.Container
- func NewAdaptiveGrid(rowcols int, objects ...core.CanvasObject) *bellui.Container
- func NewBorder(top, bottom, left, right core.CanvasObject, objects ...core.CanvasObject) *bellui.Container
- func NewCenter(objects ...core.CanvasObject) *bellui.Container
- func NewGridWithColumns(cols int, objects ...core.CanvasObject) *bellui.Container
- func NewGridWithRows(rows int, objects ...core.CanvasObject) *bellui.Container
- func NewGridWrap(size geo.Size, objects ...core.CanvasObject) *bellui.Container
- func NewHBox(objects ...core.CanvasObject) *bellui.Container
- func NewPadded(objects ...core.CanvasObject) *bellui.Container
- func NewStack(objects ...core.CanvasObject) *bellui.Container
- func NewVBox(objects ...core.CanvasObject) *bellui.Container
- func NewWithoutLayout(objects ...core.CanvasObject) *bellui.Container
- type AppTabs
- func (t *AppTabs) AccessibleLabel() string
- func (t *AppTabs) AccessibleRole() core.AccessibleRole
- func (t *AppTabs) Append(item *TabItem)
- func (t *AppTabs) CreateRenderer() core.WidgetRenderer
- func (t *AppTabs) DisableIndex(i int)
- func (t *AppTabs) DisableItem(item *TabItem)
- func (t *AppTabs) EnableIndex(i int)
- func (t *AppTabs) EnableItem(item *TabItem)
- func (t *AppTabs) Hide()
- func (t *AppTabs) MinSize() geo.Size
- func (t *AppTabs) Remove(item *TabItem)
- func (t *AppTabs) RemoveIndex(index int)
- func (t *AppTabs) Select(item *TabItem)
- func (t *AppTabs) SelectIndex(index int)
- func (t *AppTabs) Selected() *TabItem
- func (t *AppTabs) SelectedIndex() int
- func (t *AppTabs) SetItems(items []*TabItem)
- func (t *AppTabs) SetTabLocation(l TabLocation)
- func (t *AppTabs) Show()
- type Clip
- type DirectionScope
- type DocTabs
- func (t *DocTabs) AccessibleLabel() string
- func (t *DocTabs) AccessibleRole() core.AccessibleRole
- func (t *DocTabs) Append(item *TabItem)
- func (t *DocTabs) CreateRenderer() core.WidgetRenderer
- func (t *DocTabs) DisableIndex(i int)
- func (t *DocTabs) DisableItem(item *TabItem)
- func (t *DocTabs) EnableIndex(i int)
- func (t *DocTabs) EnableItem(item *TabItem)
- func (t *DocTabs) Hide()
- func (t *DocTabs) MinSize() geo.Size
- func (t *DocTabs) Remove(item *TabItem)
- func (t *DocTabs) RemoveIndex(index int)
- func (t *DocTabs) Select(item *TabItem)
- func (t *DocTabs) SelectIndex(index int)
- func (t *DocTabs) Selected() *TabItem
- func (t *DocTabs) SelectedIndex() int
- func (t *DocTabs) SetItems(items []*TabItem)
- func (t *DocTabs) SetTabLocation(l TabLocation)
- func (t *DocTabs) Show()
- type InnerWindow
- func (w *InnerWindow) Close()
- func (w *InnerWindow) Content() core.CanvasObject
- func (w *InnerWindow) CreateRenderer() core.WidgetRenderer
- func (w *InnerWindow) SetContent(obj core.CanvasObject)
- func (w *InnerWindow) SetMaximized(max bool)
- func (w *InnerWindow) SetPadded(pad bool)
- func (w *InnerWindow) SetTitle(title string)
- type MultipleWindows
- type Navigation
- func (nav *Navigation) Back() core.CanvasObject
- func (nav *Navigation) CreateRenderer() core.WidgetRenderer
- func (nav *Navigation) Forward() core.CanvasObject
- func (nav *Navigation) Push(obj core.CanvasObject)
- func (nav *Navigation) PushWithTitle(obj core.CanvasObject, s string)
- func (nav *Navigation) SetCurrentTitle(s string)
- func (nav *Navigation) SetTitle(s string)
- type Paned
- type PathClip
- type RepaintBoundary
- type Scroll
- type ScrollDirection
- type Split
- type TabItem
- type TabLocation
- type ThemeOverride
Constants ¶
const ( // ScrollBoth supports horizontal and vertical scrolling. ScrollBoth ScrollDirection = bellui.ScrollBoth // ScrollHorizontalOnly specifies the scrolling should only happen left to right. ScrollHorizontalOnly = bellui.ScrollHorizontalOnly // ScrollVerticalOnly specifies the scrolling should only happen top to bottom. ScrollVerticalOnly = bellui.ScrollVerticalOnly // ScrollNone turns off scrolling for this container. // // Since: 2.1 ScrollNone = bellui.ScrollNone )
Constants for valid values of ScrollDirection.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New returns a new Container instance holding the specified CanvasObjects which will be laid out according to the specified Layout.
Since: 2.0
func NewAdaptiveGrid ¶
func NewAdaptiveGrid(rowcols int, objects ...core.CanvasObject) *bellui.Container
NewAdaptiveGrid creates a new container with the specified objects and using the grid layout. When in a horizontal arrangement the rowcols parameter will specify the column count, when in vertical it will specify the rows. On mobile this will dynamically refresh when device is rotated.
Since: 1.4
func NewBorder ¶
func NewBorder(top, bottom, left, right core.CanvasObject, objects ...core.CanvasObject) *bellui.Container
NewBorder creates a new container with the specified objects and using the border layout. The top, bottom, left and right parameters specify the items that should be placed around edges. Nil can be used to an edge if it should not be filled. Passed objects not assigned to any edge (parameters 5 onwards) will be used to fill the space remaining in the middle. Parameters 6 onwards will be stacked over the middle content in the specified order as a Stack container.
Since: 1.4
func NewCenter ¶
func NewCenter(objects ...core.CanvasObject) *bellui.Container
NewCenter creates a new container with the specified objects centered in the available space.
Since: 1.4
func NewGridWithColumns ¶
func NewGridWithColumns(cols int, objects ...core.CanvasObject) *bellui.Container
NewGridWithColumns creates a new container with the specified objects and using the grid layout with a specified number of columns. The number of rows will depend on how many children are in the container.
Since: 1.4
func NewGridWithRows ¶
func NewGridWithRows(rows int, objects ...core.CanvasObject) *bellui.Container
NewGridWithRows creates a new container with the specified objects and using the grid layout with a specified number of rows. The number of columns will depend on how many children are in the container.
Since: 1.4
func NewGridWrap ¶
NewGridWrap creates a new container with the specified objects and using the gridwrap layout. Every element will be resized to the size parameter and the content will arrange along a row and flow to a new row if the elements don't fit.
Since: 1.4
func NewHBox ¶
func NewHBox(objects ...core.CanvasObject) *bellui.Container
NewHBox creates a new container with the specified objects and using the HBox layout. The objects will be placed in the container from left to right and always displayed at their horizontal MinSize. Use a different layout if the objects are intended to be larger then their horizontal MinSize.
Since: 1.4
func NewPadded ¶
func NewPadded(objects ...core.CanvasObject) *bellui.Container
NewPadded creates a new container with the specified objects inset by standard padding size.
Since: 1.4
func NewStack ¶
func NewStack(objects ...core.CanvasObject) *bellui.Container
NewStack returns a new container that stacks objects on top of each other. Objects at the end of the container will be stacked on top of objects before. Having only a single object has no impact as CanvasObjects will fill the available space even without a Stack.
Since: 2.4
func NewVBox ¶
func NewVBox(objects ...core.CanvasObject) *bellui.Container
NewVBox creates a new container with the specified objects and using the VBox layout. The objects will be stacked in the container from top to bottom and always displayed at their vertical MinSize. Use a different layout if the objects are intended to be larger then their vertical MinSize.
Since: 1.4
func NewWithoutLayout ¶
func NewWithoutLayout(objects ...core.CanvasObject) *bellui.Container
NewWithoutLayout returns a new Container instance holding the specified CanvasObjects that are manually arranged.
Since: 2.0
Types ¶
type AppTabs ¶
type AppTabs struct {
widget.BaseWidget
Items []*TabItem
OnSelected func(*TabItem) `json:"-"`
OnUnselected func(*TabItem) `json:"-"`
// contains filtered or unexported fields
}
AppTabs container is used to split your application into various different areas identified by tabs. The tabs contain text and/or an icon and allow the user to switch between the content specified in each TabItem. Each item is represented by a button at the edge of the container.
Since: 1.4
func NewAppTabs ¶
NewAppTabs creates a new tab container that allows the user to choose between different areas of an app.
Since: 1.4
func (*AppTabs) AccessibleLabel ¶
AccessibleLabel returns an empty string; tab containers have no intrinsic label.
func (*AppTabs) AccessibleRole ¶
func (t *AppTabs) AccessibleRole() core.AccessibleRole
AccessibleRole returns core.RoleTabList.
func (*AppTabs) CreateRenderer ¶
func (t *AppTabs) CreateRenderer() core.WidgetRenderer
CreateRenderer is a private method to Bellui which links this widget to its renderer
func (*AppTabs) RemoveIndex ¶
RemoveIndex removes tab by index.
func (*AppTabs) SelectIndex ¶
SelectIndex sets the TabItem at the specific index to be selected and its content visible.
func (*AppTabs) SelectedIndex ¶
SelectedIndex returns the index of the currently selected TabItem.
func (*AppTabs) SetTabLocation ¶
func (t *AppTabs) SetTabLocation(l TabLocation)
SetTabLocation sets the location of the tab bar
type Clip ¶
type Clip struct {
widget.BaseWidget
Content core.CanvasObject
}
Clip describes a rectangular region that will clip anything outside its bounds.
Since: 2.7
func NewClip ¶
func NewClip(content core.CanvasObject) *Clip
NewClip returns a new rectangular clipping object.
Since: 2.7
func (*Clip) CreateRenderer ¶
func (c *Clip) CreateRenderer() core.WidgetRenderer
type DirectionScope ¶
type DirectionScope struct {
widget.BaseWidget
// Content is the object whose subtree adopts Direction.
Content core.CanvasObject
// Direction is the ambient direction applied to Content. Changing it at
// runtime requires a call to [DirectionScope.Refresh] (use
// [DirectionScope.SetDirection], which does this for you).
Direction bellui.Direction
// contains filtered or unexported fields
}
DirectionScope is a container that establishes an ambient user-interface direction for its content, overriding the process-wide github.com/belluikit/bellui.SetLayoutDirection for everything inside it. It lets a left-to-right subtree — for example an LTR settings dialog — flow naturally inside an otherwise right-to-left application (and vice versa).
The scope governs layout mirroring, leading/trailing alignment, focus order and the base writing direction used while the subtree is measured and laid out. As with the process-global setting, mixed-direction text within a single run is still controlled per run by github.com/belluikit/bellui.TextStyle.Direction.
Passing github.com/belluikit/bellui.DirectionAuto makes the scope inherit the enclosing direction, so it is a no-op wrapper; use [DirectionLTR] or [DirectionRTL] to force a direction. Scopes nest, with the innermost winning.
Since: 2.8
func NewDirectionScope ¶
func NewDirectionScope(obj core.CanvasObject, dir bellui.Direction) *DirectionScope
NewDirectionScope returns a DirectionScope that lays out and paints obj under the given direction, regardless of the process-wide setting. Pass github.com/belluikit/bellui.DirectionLTR or [DirectionRTL] to force a direction; [DirectionAuto] inherits the enclosing direction.
Since: 2.8
func (*DirectionScope) CreateRenderer ¶
func (d *DirectionScope) CreateRenderer() core.WidgetRenderer
CreateRenderer is an internal method.
func (*DirectionScope) Refresh ¶
func (d *DirectionScope) Refresh()
Refresh re-applies the scope to its content. Call it after adding items to the content container (or any sub-container) so the new items adopt the direction, mirroring ThemeOverride.Refresh.
func (*DirectionScope) ScopedDirection ¶
func (d *DirectionScope) ScopedDirection() bellui.Direction
ScopedDirection reports the ambient direction this scope applies to its subtree. The driver paint walks read it structurally (via an interface, to avoid importing this package) so they can push the scope onto the per-goroutine uidir stack while painting the subtree — the paint-time mirror of the layout hook in internal/driver/common.Canvas.EnsureMinSize.
func (*DirectionScope) SetDirection ¶
func (d *DirectionScope) SetDirection(dir bellui.Direction)
SetDirection updates the ambient direction applied to the content and re-lays-out the subtree. It is a no-op when the direction is unchanged.
Since: 2.8
type DocTabs ¶
type DocTabs struct {
widget.BaseWidget
Items []*TabItem
CreateTab func() *TabItem `json:"-"`
CloseIntercept func(*TabItem) `json:"-"`
OnClosed func(*TabItem) `json:"-"`
OnSelected func(*TabItem) `json:"-"`
OnUnselected func(*TabItem) `json:"-"`
// contains filtered or unexported fields
}
DocTabs container is used to display various pieces of content identified by tabs. The tabs contain text and/or an icon and allow the user to switch between the content specified in each TabItem. Each item is represented by a button at the edge of the container.
Since: 2.1
func NewDocTabs ¶
NewDocTabs creates a new tab container that allows the user to choose between various pieces of content.
Since: 2.1
func (*DocTabs) AccessibleLabel ¶
AccessibleLabel returns an empty string; tab containers have no intrinsic label.
func (*DocTabs) AccessibleRole ¶
func (t *DocTabs) AccessibleRole() core.AccessibleRole
AccessibleRole returns core.RoleTabList.
func (*DocTabs) CreateRenderer ¶
func (t *DocTabs) CreateRenderer() core.WidgetRenderer
CreateRenderer is a private method to Bellui which links this widget to its renderer
func (*DocTabs) RemoveIndex ¶
RemoveIndex removes tab by index.
func (*DocTabs) SelectIndex ¶
SelectIndex sets the TabItem at the specific index to be selected and its content visible.
func (*DocTabs) SelectedIndex ¶
SelectedIndex returns the index of the currently selected TabItem.
func (*DocTabs) SetTabLocation ¶
func (t *DocTabs) SetTabLocation(l TabLocation)
SetTabLocation sets the location of the tab bar
type InnerWindow ¶
type InnerWindow struct {
widget.BaseWidget
CloseIntercept func() `json:"-"`
OnDragged, OnResized func(*event.DragEvent) `json:"-"`
OnMinimized, OnMaximized, OnTappedBar, OnTappedIcon func() `json:"-"`
Icon bellui.Resource
// Alignment allows an inner window to specify if the buttons should be on the left
// (`ButtonAlignLeading`) or right of the window border.
//
// Since: 2.6
Alignment widget.ButtonAlign
// contains filtered or unexported fields
}
InnerWindow defines a container that wraps content in a window border - that can then be placed inside a regular container/canvas.
Since: 2.5
func NewInnerWindow ¶
func NewInnerWindow(title string, content core.CanvasObject) *InnerWindow
NewInnerWindow creates a new window border around the given `content`, displaying the `title` along the top. This will behave like a normal contain and will probably want to be added to a `MultipleWindows` parent.
Since: 2.5
func (*InnerWindow) Close ¶
func (w *InnerWindow) Close()
func (*InnerWindow) Content ¶
func (w *InnerWindow) Content() core.CanvasObject
Content returns the content of this inner window.
func (*InnerWindow) CreateRenderer ¶
func (w *InnerWindow) CreateRenderer() core.WidgetRenderer
func (*InnerWindow) SetContent ¶
func (w *InnerWindow) SetContent(obj core.CanvasObject)
SetContent sets the content of this inner window.
func (*InnerWindow) SetMaximized ¶
func (w *InnerWindow) SetMaximized(max bool)
SetMaximized tells the window if the maximized state should be set or not.
Since: 2.6
func (*InnerWindow) SetPadded ¶
func (w *InnerWindow) SetPadded(pad bool)
func (*InnerWindow) SetTitle ¶
func (w *InnerWindow) SetTitle(title string)
type MultipleWindows ¶
type MultipleWindows struct {
widget.BaseWidget
Windows []*InnerWindow
// contains filtered or unexported fields
}
MultipleWindows is a container that handles multiple `InnerWindow` containers. Each inner window can be dragged, resized and the stacking will change when the title bar is tapped.
Since: 2.5
func NewMultipleWindows ¶
func NewMultipleWindows(wins ...*InnerWindow) *MultipleWindows
NewMultipleWindows creates a new `MultipleWindows` container to manage many inner windows. The initial window list is passed optionally to this constructor function. You can add new more windows to this container by calling `Add` or updating the `Windows` field and calling `Refresh`.
Since: 2.5
func (*MultipleWindows) Add ¶
func (m *MultipleWindows) Add(w *InnerWindow)
func (*MultipleWindows) CreateRenderer ¶
func (m *MultipleWindows) CreateRenderer() core.WidgetRenderer
func (*MultipleWindows) Refresh ¶
func (m *MultipleWindows) Refresh()
type Navigation ¶
type Navigation struct {
// contains filtered or unexported fields
}
Navigation container is used to provide your application with a control bar and an area for content objects. Objects can be any CanvasObject, and only the most recent one will be visible.
Since: 2.7
func NewNavigation ¶
func NewNavigation(root core.CanvasObject) *Navigation
NewNavigation creates a new navigation container with a given root object.
Since: 2.7
func NewNavigationWithTitle ¶
func NewNavigationWithTitle(root core.CanvasObject, s string) *Navigation
NewNavigationWithTitle creates a new navigation container with a given root object and a default title.
Since: 2.7
func (*Navigation) Back ¶
func (nav *Navigation) Back() core.CanvasObject
Back returns the top level CanvasObject, adjusts the title accordingly, and disabled the back button when no more objects are left to go back to.
Since: 2.7
func (*Navigation) CreateRenderer ¶
func (nav *Navigation) CreateRenderer() core.WidgetRenderer
func (*Navigation) Forward ¶
func (nav *Navigation) Forward() core.CanvasObject
Forward shows the next object in the stack again and returns the object that was visible before.
Since: 2.7
func (*Navigation) Push ¶
func (nav *Navigation) Push(obj core.CanvasObject)
Push puts the given object on top of the navigation stack and hides the object below.
Since: 2.7
func (*Navigation) PushWithTitle ¶
func (nav *Navigation) PushWithTitle(obj core.CanvasObject, s string)
PushWithTitle puts the given CanvasObject on top, hides the object below, and uses the given title as label text.
Since: 2.7
func (*Navigation) SetCurrentTitle ¶
func (nav *Navigation) SetCurrentTitle(s string)
SetCurrentTitle changes the navigation title for the current level.
Since: 2.7
func (*Navigation) SetTitle ¶
func (nav *Navigation) SetTitle(s string)
SetTitle changes the root navigation title shown by default.
Since: 2.7
type Paned ¶
type Paned struct {
widget.BaseWidget
Horizontal bool
Panels []core.CanvasObject
Weights []float64 // proportional weights for each panel (auto-normalized)
}
Paned is a container that arranges multiple children with draggable dividers between them. Unlike Split (which handles exactly 2 children), Paned supports an arbitrary number of panels arranged horizontally or vertically.
Each panel is assigned a weight that determines its proportion of the available space. Weights are normalized automatically.
Since: 2.7
func NewHPaned ¶
func NewHPaned(panels ...core.CanvasObject) *Paned
NewHPaned creates a horizontally arranged paned container. Panels are laid out left to right with vertical dividers between them.
Since: 2.7
func NewVPaned ¶
func NewVPaned(panels ...core.CanvasObject) *Paned
NewVPaned creates a vertically arranged paned container. Panels are laid out top to bottom with horizontal dividers between them.
Since: 2.7
func (*Paned) AddPanel ¶
func (p *Paned) AddPanel(panel core.CanvasObject)
AddPanel appends a new panel with default weight 1.0.
func (*Paned) CreateRenderer ¶
func (p *Paned) CreateRenderer() core.WidgetRenderer
CreateRenderer creates the renderer for the paned container.
func (*Paned) RemovePanel ¶
RemovePanel removes the panel at the given index.
type PathClip ¶
type PathClip struct {
widget.BaseWidget
ClipPath *canvas.Path
Content core.CanvasObject
}
PathClip clips its content to an arbitrary path shape using stencil-based clipping. The ClipPath defines the region inside which content is visible.
func NewPathClip ¶
func NewPathClip(clipPath *canvas.Path, content core.CanvasObject) *PathClip
NewPathClip returns a new path-clipping container.
func (*PathClip) CreateRenderer ¶
func (pc *PathClip) CreateRenderer() core.WidgetRenderer
CreateRenderer returns a new renderer for PathClip.
type RepaintBoundary ¶
type RepaintBoundary struct {
widget.BaseWidget
Content core.CanvasObject
}
RepaintBoundary isolates its content subtree for repaint purposes. When the subtree is unchanged, it is rendered from a cached framebuffer object (FBO) as a single textured quad, avoiding the cost of walking and drawing the entire subtree each frame.
Use this to wrap independently-updating regions of the UI (e.g. charts, video players, animated panels) so that refreshing one region does not force a full repaint of the entire canvas.
Since: 2.7
func NewRepaintBoundary ¶
func NewRepaintBoundary(content core.CanvasObject) *RepaintBoundary
NewRepaintBoundary creates a new RepaintBoundary wrapping the given content.
Since: 2.7
func (*RepaintBoundary) CreateRenderer ¶
func (rb *RepaintBoundary) CreateRenderer() core.WidgetRenderer
CreateRenderer returns a renderer for the RepaintBoundary.
type Scroll ¶
Scroll defines a container that is smaller than the Content. The Offset is used to determine the position of the child widgets within the container.
Since: 1.4
func NewHScroll ¶
func NewHScroll(content core.CanvasObject) *Scroll
NewHScroll create a scrollable parent wrapping the specified content. Note that this may cause the MinSize.Width to be smaller than that of the passed object.
Since: 1.4
func NewScroll ¶
func NewScroll(content core.CanvasObject) *Scroll
NewScroll creates a scrollable parent wrapping the specified content. Note that this may cause the MinSize to be smaller than that of the passed object.
Since: 1.4
func NewVScroll ¶
func NewVScroll(content core.CanvasObject) *Scroll
NewVScroll a scrollable parent wrapping the specified content. Note that this may cause the MinSize.Height to be smaller than that of the passed object.
Since: 1.4
type ScrollDirection ¶
type ScrollDirection = bellui.ScrollDirection
ScrollDirection represents the directions in which a Scroll container can scroll its child content.
Since: 1.4
type Split ¶
type Split struct {
widget.BaseWidget
Offset float64
Horizontal bool
Leading core.CanvasObject
Trailing core.CanvasObject
// contains filtered or unexported fields
}
Split defines a container whose size is split between two children.
Since: 1.4
func NewHSplit ¶
func NewHSplit(leading, trailing core.CanvasObject) *Split
NewHSplit creates a horizontally arranged container with the specified leading and trailing elements. A vertical split bar that can be dragged will be added between the elements.
Since: 1.4
func NewVSplit ¶
func NewVSplit(top, bottom core.CanvasObject) *Split
NewVSplit creates a vertically arranged container with the specified top and bottom elements. A horizontal split bar that can be dragged will be added between the elements.
Since: 1.4
func (*Split) CreateRenderer ¶
func (s *Split) CreateRenderer() core.WidgetRenderer
CreateRenderer is a private method to Bellui which links this widget to its renderer
type TabItem ¶
type TabItem struct {
Text string
Icon bellui.Resource
Content core.CanvasObject
// contains filtered or unexported fields
}
TabItem represents a single view in a tab view. The Text and Icon are used for the tab button and the Content is shown when the corresponding tab is active.
Since: 1.4
func NewTabItem ¶
func NewTabItem(text string, content core.CanvasObject) *TabItem
NewTabItem creates a new item for a tabbed widget - each item specifies the content and a label for its tab.
Since: 1.4
func NewTabItemWithIcon ¶
NewTabItemWithIcon creates a new item for a tabbed widget - each item specifies the content and a label with an icon for its tab.
Since: 1.4
type TabLocation ¶
type TabLocation int
TabLocation is the location where the tabs of a tab container should be rendered
Since: 1.4
const ( TabLocationTop TabLocation = iota TabLocationLeading TabLocationBottom TabLocationTrailing )
TabLocation values
type ThemeOverride ¶
type ThemeOverride struct {
widget.BaseWidget
Content core.CanvasObject
Theme bellui.Theme
// contains filtered or unexported fields
}
ThemeOverride is a container where the child widgets are themed by the specified theme. Containers will be traversed and all child widgets will reflect the theme in this container. This should be used sparingly to avoid a jarring user experience.
Since: 2.5
func NewThemeOverride ¶
func NewThemeOverride(obj core.CanvasObject, th bellui.Theme) *ThemeOverride
NewThemeOverride provides a container where the child widgets are themed by the specified theme. Containers will be traversed and all child widgets will reflect the theme in this container. This should be used sparingly to avoid a jarring user experience.
If the content `obj` of this theme override is a container and items are later added to the container or any sub-containers ensure that you call `Refresh()` on this `ThemeOverride` to ensure the new items match the theme.
Since: 2.5
func (*ThemeOverride) CreateRenderer ¶
func (t *ThemeOverride) CreateRenderer() core.WidgetRenderer
func (*ThemeOverride) Refresh ¶
func (t *ThemeOverride) Refresh()
func (*ThemeOverride) SetDeviceIsMobile ¶
func (t *ThemeOverride) SetDeviceIsMobile(on bool)
SetDeviceIsMobile allows a ThemeOverride container to shape the contained widgets as a mobile device. This will impact containers such as AppTabs and DocTabs, and more in the future, to display a layout that would automatically be used for a mobile device runtime.
Since: 2.6