OutlineProperty

Defines the View's outside border

Create from source

func NewOutlineProperty(params Params) OutlineProperty

Create a new outline property and return its interface

Create from resource

View {
    width = 100%,
    height = 100%,
    outline = _{
        style = dashed,
        width = 1px,
        color = #FF919191,
    },
}

Interface description

Inherit methods from Properties, fmt.Stringer

ViewOutline(session Session) ViewOutline

Returns style color and line width of an outline

Properties

"color"

Outline line color

Constant: ColorTag

Types: Color, string

Internal type is Color, other types converted to it during assignment

See Color description for more details

Examples

GridLayout {
    width = 100%,
    height = 100%,
    cell-vertical-align = center,
    cell-horizontal-align = center,
    content = TextView {
        text = "Some text",
        outline= _{ style = solid, width = 2px, color = gray},
        radius = 2px,
    },
}
view := rui.NewGridLayout(session, rui.Params{
    rui.Width:               rui.Percent(100),
    rui.Height:              rui.Percent(100),
    rui.CellVerticalAlign:   rui.CenterAlign,
    rui.CellHorizontalAlign: rui.CenterAlign,
    rui.Content: []rui.View{
        rui.NewTextView(session, rui.Params{
            rui.Text: "Some text",
            rui.Outline: rui.NewOutlineProperty(rui.Params{
                rui.Style:    rui.SolidLine,
                rui.Width:    rui.Px(2),
                rui.ColorTag: rui.Gray,
            }),
            rui.Radius: rui.Px(2),
        }),
    },
})

"style"

Outline line style

Constant: Style

Types: int, string

Values

int string Description
0(NoneLine) "none" The outline will not be drawn
1(SolidLine) "solid" Solid line as an outline
2(DashedLine) "dashed" Dashed line as an outline
3(DottedLine) "dotted" Dotted line as an outline
4(DoubleLine) "double" Double line as an outline

"width"

Outline line width

Constant: Width

Types: SizeUnit, string

Internal type is SizeUnit, other types converted to it during assignment

See SizeUnit description for more details

Examples

GridLayout {
    width = 100%,
    height = 100%,
    cell-vertical-align = center,
    cell-horizontal-align = center,
    content = TextView {
        text = "Some text",
        outline= _{ style = solid, width = 2px, color = gray},
        radius = 2px,
    },
}
view := rui.NewGridLayout(session, rui.Params{
    rui.Width:               rui.Percent(100),
    rui.Height:              rui.Percent(100),
    rui.CellVerticalAlign:   rui.CenterAlign,
    rui.CellHorizontalAlign: rui.CenterAlign,
    rui.Content: []rui.View{
        rui.NewTextView(session, rui.Params{
            rui.Text: "Some text",
            rui.Outline: rui.NewOutlineProperty(rui.Params{
                rui.Style:    rui.SolidLine,
                rui.Width:    rui.Px(2),
                rui.ColorTag: rui.Gray,
            }),
            rui.Radius: rui.Px(2),
        }),
    },
})
func GetOutline(view View, subviewID ...string) ViewOutline

Returns ViewOutline of the subview. If the second argument (subviewID) is not specified or is an empty string then a ViewOutline of the first argument (view) is returned