Re-added OnScrollBoundsChange methods because they are useful

This commit is contained in:
2023-03-15 23:56:00 -04:00
parent 639baecee5
commit 8aaa017902
3 changed files with 23 additions and 1 deletions
+7
View File
@@ -34,6 +34,7 @@ type TextBox struct {
onKeyDown func (key input.Key, modifiers input.Modifiers) (handled bool)
onChange func ()
onScrollBoundsChange func ()
}
// NewTextBox creates a new text box with the specified placeholder text, and
@@ -241,6 +242,12 @@ func (element *TextBox) OnChange (callback func ()) {
element.onChange = callback
}
// OnScrollBoundsChange sets a function to be called when the element's viewport
// bounds, content bounds, or scroll axes change.
func (element *TextBox) OnScrollBoundsChange (callback func ()) {
element.onScrollBoundsChange = callback
}
// ScrollContentBounds returns the full content size of the element.
func (element *TextBox) ScrollContentBounds () (bounds image.Rectangle) {
bounds = element.valueDrawer.LayoutBounds()