2021-09-07 17:36:50 +03:00
|
|
|
package rui
|
|
|
|
|
2024-09-12 14:05:11 +03:00
|
|
|
// Button represent a Button view
|
2021-09-07 17:36:50 +03:00
|
|
|
type Button interface {
|
|
|
|
CustomView
|
|
|
|
}
|
|
|
|
|
|
|
|
type buttonData struct {
|
|
|
|
CustomViewData
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewButton create new Button object and return it
|
|
|
|
func NewButton(session Session, params Params) Button {
|
|
|
|
button := new(buttonData)
|
|
|
|
InitCustomView(button, "Button", session, params)
|
|
|
|
return button
|
|
|
|
}
|
|
|
|
|
|
|
|
func newButton(session Session) View {
|
|
|
|
return NewButton(session, nil)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (button *buttonData) CreateSuperView(session Session) View {
|
|
|
|
return NewListLayout(session, Params{
|
|
|
|
Semantics: ButtonSemantics,
|
|
|
|
Style: "ruiButton",
|
|
|
|
StyleDisabled: "ruiDisabledButton",
|
|
|
|
HorizontalAlign: CenterAlign,
|
|
|
|
VerticalAlign: CenterAlign,
|
|
|
|
Orientation: StartToEndOrientation,
|
2023-05-07 19:26:02 +03:00
|
|
|
TabIndex: 0,
|
2021-09-07 17:36:50 +03:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (button *buttonData) Focusable() bool {
|
|
|
|
return true
|
|
|
|
}
|