Documentation
¶
Index ¶
- Constants
- func CurrentlyRenderingWithFallback(f bellui.Theme) bellui.Theme
- func DeviceIsMobileForWidget(w core.Widget) (mobile bool, ok bool)
- func ForegroundOnPrimaryColorNamed(name string) color.Color
- func PopRenderingTheme()
- func PrimaryColorNamed(name string) color.Color
- func PushRenderingTheme(th bellui.Theme)
- type MobileTheme
- type RenderStyle
- type RenderStyleTheme
Constants ¶
const ( ColorBlue = "blue" ColorBrown = "brown" ColorGray = "gray" ColorGreen = "green" ColorOrange = "orange" ColorPurple = "purple" ColorRed = "red" ColorYellow = "yellow" )
Primary color names.
const ( VariantDark bellui.ThemeVariant = iota VariantLight VariantNameUserPreference // locally used in builtinTheme for backward compatibility )
Theme variants; the public available ones are defined in /theme/theme.go.
Variables ¶
This section is empty.
Functions ¶
func CurrentlyRenderingWithFallback ¶
CurrentlyRenderingWithFallback returns the theme that is currently being used during rendering or layout calculations. If there is no override in effect then the fallback is returned.
func DeviceIsMobileForWidget ¶
DeviceIsMobileForWidget checks whether the widget's theme overrides the device-is-mobile flag. Returns the override value and true if set, or false and false if no override exists.
func ForegroundOnPrimaryColorNamed ¶
ForegroundOnPrimaryColorNamed returns a theme specific color used for text and icons against the named primary color.
func PopRenderingTheme ¶
func PopRenderingTheme()
PopRenderingTheme is used by the ThemeOverride container to remove an overridden theme during rendering and calculations.
func PrimaryColorNamed ¶
PrimaryColorNamed returns a theme specific color value for a named primary color.
func PushRenderingTheme ¶
PushRenderingTheme is used by the ThemeOverride container to stack the current theme during rendering and calculations.
Types ¶
type MobileTheme ¶
type MobileTheme interface {
DeviceIsMobile() bool
}
MobileTheme is implemented by themes that override the device-is-mobile flag. ThemeOverride uses this to force mobile layout in containers like AppTabs.
type RenderStyle ¶
type RenderStyle string
RenderStyle identifies a visual rendering style that widget renderers can switch on.
const ( // RenderStyleClassic is the original Bellui look. This is the default when the // theme does not implement RenderStyleTheme. RenderStyleClassic RenderStyle = "" // RenderStyleModern provides enhanced visuals: gradient buttons, deeper shadows, // larger corner radii, and stronger hover/focus feedback. RenderStyleModern RenderStyle = "modern" )
func RenderStyleForWidget ¶
func RenderStyleForWidget(w core.Widget) RenderStyle
RenderStyleForWidget returns the RenderStyle for the given widget's theme. Returns RenderStyleClassic if the theme does not provide a render style.
type RenderStyleTheme ¶
type RenderStyleTheme interface {
RenderStyle() RenderStyle
}
RenderStyleTheme is implemented by themes that provide a render style selection. Widget renderers type-assert the current theme to this interface to decide between classic and modern visuals.