Compare commits
5 Commits
c043f9bf8d
...
6ee2c5669e
| Author | SHA1 | Date | |
|---|---|---|---|
| 6ee2c5669e | |||
| 3aa4b12ffe | |||
| c7caa5bcb6 | |||
| 0960fe013d | |||
| 697229d183 |
@ -31,7 +31,7 @@ func NewButton (text string) *Button {
|
|||||||
label: NewLabel(text),
|
label: NewLabel(text),
|
||||||
}
|
}
|
||||||
button.box.SetRole(tomo.R("objects", "Button"))
|
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.box.SetAttr(tomo.ALayout(buttonLayout))
|
||||||
button.SetText(text)
|
button.SetText(text)
|
||||||
|
|
||||||
|
|||||||
@ -44,7 +44,7 @@ func NewCalendar (tm time.Time) *Calendar {
|
|||||||
calendar.on.valueChange.Broadcast()
|
calendar.on.valueChange.Broadcast()
|
||||||
})
|
})
|
||||||
calendar.monthLabel = NewLabel("")
|
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 = tomo.NewContainerBox()
|
||||||
calendar.grid.SetRole(tomo.R("objects", "CalendarGrid"))
|
calendar.grid.SetRole(tomo.R("objects", "CalendarGrid"))
|
||||||
|
|||||||
@ -56,7 +56,7 @@ func NewDialog (kind DialogKind, parent tomo.Window, title, message string, opti
|
|||||||
dialog.SetIcon(iconId)
|
dialog.SetIcon(iconId)
|
||||||
icon := NewIcon(iconId, tomo.IconSizeLarge)
|
icon := NewIcon(iconId, tomo.IconSizeLarge)
|
||||||
messageText := NewLabel(message)
|
messageText := NewLabel(message)
|
||||||
messageText.SetAttr(tomo.AAlign(tomo.AlignStart, tomo.AlignMiddle))
|
messageText.SetAlign(tomo.AlignStart, tomo.AlignMiddle)
|
||||||
|
|
||||||
for _, option := range options {
|
for _, option := range options {
|
||||||
if option, ok := option.(clickable); ok {
|
if option, ok := option.(clickable); ok {
|
||||||
|
|||||||
23
icon.go
23
icon.go
@ -3,9 +3,11 @@ package objects
|
|||||||
import "git.tebibyte.media/tomo/tomo"
|
import "git.tebibyte.media/tomo/tomo"
|
||||||
import "git.tebibyte.media/tomo/tomo/canvas"
|
import "git.tebibyte.media/tomo/tomo/canvas"
|
||||||
|
|
||||||
|
var _ tomo.Object = new(Icon)
|
||||||
|
|
||||||
// Icon displays a single icon.
|
// Icon displays a single icon.
|
||||||
type Icon struct {
|
type Icon struct {
|
||||||
tomo.Box
|
box tomo.Box
|
||||||
icon tomo.Icon
|
icon tomo.Icon
|
||||||
size tomo.IconSize
|
size tomo.IconSize
|
||||||
}
|
}
|
||||||