Added scrollable element interface

This commit is contained in:
2023-01-18 17:32:33 -05:00
parent b69eb6b62e
commit 3889cb5252
2 changed files with 31 additions and 9 deletions

View File

@@ -182,15 +182,6 @@ func (element *TextBox) SetPlaceholder (placeholder string) {
}
}
func (element *TextBox) updateMinimumSize () {
textBounds := element.placeholderDrawer.LayoutBounds()
element.core.SetMinimumSize (
textBounds.Dx() +
theme.Padding() * 2,
element.placeholderDrawer.LineHeight().Round() +
theme.Padding() * 2)
}
func (element *TextBox) SetValue (text string) {
// if element.text == text { return }
@@ -230,6 +221,15 @@ func (element *TextBox) OnChange (callback func ()) {
element.onChange = callback
}
func (element *TextBox) updateMinimumSize () {
textBounds := element.placeholderDrawer.LayoutBounds()
element.core.SetMinimumSize (
textBounds.Dx() +
theme.Padding() * 2,
element.placeholderDrawer.LineHeight().Round() +
theme.Padding() * 2)
}
func (element *TextBox) runOnChange () {
if element.onChange != nil {
element.onChange()