diff --git a/checkbox.go b/checkbox.go index c7a8181..9eeb778 100644 --- a/checkbox.go +++ b/checkbox.go @@ -31,8 +31,7 @@ func NewCheckbox (value bool) *Checkbox { func (this *Checkbox) SetValue (value bool) { this.value = value if this.value { - // FIXME: we need checkbox icons - this.SetTextureCenter(tomo.Icon("").Texture(tomo.IconSizeSmall)) + this.SetTextureCenter(tomo.IconCheckboxChecked.Texture(tomo.IconSizeSmall)) } else { this.SetTextureCenter(nil) } diff --git a/dialog.go b/dialog.go index f5dbd1b..448c038 100644 --- a/dialog.go +++ b/dialog.go @@ -75,8 +75,7 @@ func NewDialog (kind DialogKind, parent tomo.Window, title, message string, opti // NewDialogOk creates a new dialog window with an OK option. func NewDialogOk (kind DialogKind, parent tomo.Window, title, message string, onOk func ()) (*Dialog, error) { okButton := NewButton("OK") - // FIXME: need dialog accept/reject action icons - // okButton.SetIcon(tomo.IconStatusOkay) + okButton.SetIcon(tomo.IconDialogOkay) okButton.OnClick(func () { if onOk != nil { onOk() } }) @@ -88,12 +87,10 @@ func NewDialogOk (kind DialogKind, parent tomo.Window, title, message string, on // NewDialogOkCancel creates a new dialog window with OK and Cancel options. func NewDialogOkCancel (kind DialogKind, parent tomo.Window, title, message string, onOk func ()) (*Dialog, error) { cancelButton := NewButton("Cancel") - // FIXME: need dialog accept/reject action icons - // cancelButton.SetIcon(tomo.IconStatusCancel) + cancelButton.SetIcon(tomo.IconDialogCancel) okButton := NewButton("OK") - // FIXME: need dialog accept/reject action icons - // okButton.SetIcon(tomo.IconStatusOkay) + okButton.SetIcon(tomo.IconDialogOkay) okButton.OnClick(func () { if onOk != nil { onOk() } }) diff --git a/go.mod b/go.mod index f6a91c9..cd667bd 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,6 @@ module git.tebibyte.media/tomo/objects go 1.20 -require git.tebibyte.media/tomo/tomo v0.33.0 +require git.tebibyte.media/tomo/tomo v0.34.0 require golang.org/x/image v0.11.0 // indirect diff --git a/go.sum b/go.sum index 8f419ab..9af9d3a 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.tebibyte.media/tomo/tomo v0.33.0 h1:BBm1oRsogBLeqVKeevNqG9RPCOdmbGeiQM/9hd2GHE8= -git.tebibyte.media/tomo/tomo v0.33.0/go.mod h1:C9EzepS9wjkTJjnZaPBh22YvVPyA4hbBAJVU20Rdmps= +git.tebibyte.media/tomo/tomo v0.34.0 h1:r5yJPks9rtzdDI2RyAUdqa1qb6BebG0QFe2cTmcFi+0= +git.tebibyte.media/tomo/tomo v0.34.0/go.mod h1:C9EzepS9wjkTJjnZaPBh22YvVPyA4hbBAJVU20Rdmps= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= diff --git a/numberinput.go b/numberinput.go index c209266..a2c3830 100644 --- a/numberinput.go +++ b/numberinput.go @@ -33,8 +33,8 @@ func NewNumberInput (value float64) *NumberInput { box.Add(box.decrement) box.Add(box.increment) box.SetLayout(layouts.NewGrid([]bool { true, false, false }, []bool { true })) - box.increment.SetIcon(tomo.IconListAdd) // FIXME: need incr/decrment icons - box.decrement.SetIcon(tomo.IconListRemove) + box.increment.SetIcon(tomo.IconValueIncrement) + box.decrement.SetIcon(tomo.IconValueDecrement) box.SetValue(value) diff --git a/scrollbar.go b/scrollbar.go index 8d8d6b0..4f4f5da 100644 --- a/scrollbar.go +++ b/scrollbar.go @@ -306,9 +306,10 @@ func (this scrollbarLayout) Arrange (hints tomo.LayoutHints, boxes []tomo.Box) { handleLength := gutterLength * this.viewportContentRatio() if handleLength < handleMin { handleLength = handleMin } if handleLength >= gutterLength { - // just hide the handle if it isn't needed. - // TODO: we need a way to hide and show boxes, this is janky as - // fuck + // just hide the handle if it isn't needed. we are the layout + // and we shouldn't be adding and removing boxes, so this is + // really the only good way to hide things. + // TODO perhaps have a "Hidden" rectangle in the Tomo API? boxes[0].SetBounds(image.Rect(-16, -16, 0, 0)) return }