diff --git a/button.go b/button.go index d8ece2d..3ed6655 100644 --- a/button.go +++ b/button.go @@ -31,7 +31,7 @@ func NewButton (text string) *Button { label: NewLabel(text), } button.box.SetRole(tomo.R("objects", "Button")) - button.label.SetAttr(tomo.AAlign(tomo.AlignMiddle, tomo.AlignMiddle)) + button.label.SetAlign(tomo.AlignMiddle, tomo.AlignMiddle) button.box.SetAttr(tomo.ALayout(buttonLayout)) button.SetText(text) diff --git a/calendar.go b/calendar.go index 82118af..a6739ee 100644 --- a/calendar.go +++ b/calendar.go @@ -44,7 +44,7 @@ func NewCalendar (tm time.Time) *Calendar { calendar.on.valueChange.Broadcast() }) calendar.monthLabel = NewLabel("") - calendar.monthLabel.SetAttr(tomo.AAlign(tomo.AlignMiddle, tomo.AlignMiddle)) + calendar.monthLabel.SetAlign(tomo.AlignMiddle, tomo.AlignMiddle) calendar.grid = tomo.NewContainerBox() calendar.grid.SetRole(tomo.R("objects", "CalendarGrid")) diff --git a/dialog.go b/dialog.go index 2fea83c..b92329a 100644 --- a/dialog.go +++ b/dialog.go @@ -56,7 +56,7 @@ func NewDialog (kind DialogKind, parent tomo.Window, title, message string, opti dialog.SetIcon(iconId) icon := NewIcon(iconId, tomo.IconSizeLarge) messageText := NewLabel(message) - messageText.SetAttr(tomo.AAlign(tomo.AlignStart, tomo.AlignMiddle)) + messageText.SetAlign(tomo.AlignStart, tomo.AlignMiddle) for _, option := range options { if option, ok := option.(clickable); ok { diff --git a/labelcheckbox.go b/labelcheckbox.go index 6c0ff31..2e5ad50 100644 --- a/labelcheckbox.go +++ b/labelcheckbox.go @@ -23,9 +23,9 @@ func NewLabelCheckbox (value bool, text string) *LabelCheckbox { label: NewLabel(text), } labelCheckbox.box.SetRole(tomo.R("objects", "LabelCheckbox")) - labelCheckbox.label.SetAttr(tomo.AAlign(tomo.AlignStart, tomo.AlignMiddle)) - labelCheckbox.label.SetSelectable(false) - labelCheckbox.label.SetFocusable(false) + labelCheckbox.label.SetAlign(tomo.AlignStart, tomo.AlignMiddle) + labelCheckbox.label.GetBox().(tomo.TextBox).SetSelectable(false) + labelCheckbox.label.GetBox().(tomo.TextBox).SetFocusable(false) labelCheckbox.box.Add(labelCheckbox.checkbox) labelCheckbox.box.Add(labelCheckbox.label) labelCheckbox.box.SetAttr(tomo.ALayout(layouts.Row { false, true })) diff --git a/labelswatch.go b/labelswatch.go index da54cd3..5d9866a 100644 --- a/labelswatch.go +++ b/labelswatch.go @@ -23,9 +23,9 @@ func NewLabelSwatch (value color.Color, text string) *LabelSwatch { } box.SetRole(tomo.R("objects", "LabelSwatch")) box.swatch.label = text - box.label.SetAttr(tomo.AAlign(tomo.AlignStart, tomo.AlignMiddle)) - box.label.SetSelectable(false) - box.label.SetFocusable(false) + box.label.SetAlign(tomo.AlignStart, tomo.AlignMiddle) + box.label.GetBox().(tomo.TextBox).SetSelectable(false) + box.label.GetBox().(tomo.TextBox).SetFocusable(false) box.Add(box.swatch) box.Add(box.label) box.SetAttr(tomo.ALayout(layouts.Row { false, true })) diff --git a/menuitem.go b/menuitem.go index 2c2e262..31e736f 100644 --- a/menuitem.go +++ b/menuitem.go @@ -31,7 +31,7 @@ func NewIconMenuItem (icon tomo.Icon, text string) *MenuItem { icon: NewIcon(icon, tomo.IconSizeSmall), } box.SetRole(tomo.R("objects", "MenuItem")) - box.label.SetAttr(tomo.AAlign(tomo.AlignStart, tomo.AlignMiddle)) + box.label.SetAlign(tomo.AlignStart, tomo.AlignMiddle) box.SetAttr(tomo.ALayout(layouts.Row { false, true })) box.Add(box.icon)