ScrollToThis tells this widget's parent frame to scroll to keep this widget in view. It returns whether any scrolling was done.
()
| 270 | // ScrollToThis tells this widget's parent frame to scroll to keep |
| 271 | // this widget in view. It returns whether any scrolling was done. |
| 272 | func (wb *WidgetBase) ScrollToThis() bool { |
| 273 | if wb.This == nil { |
| 274 | return false |
| 275 | } |
| 276 | fr := wb.parentScrollFrame() |
| 277 | if fr == nil { |
| 278 | return false |
| 279 | } |
| 280 | return fr.scrollToWidget(wb.This.(Widget)) |
| 281 | } |
| 282 | |
| 283 | // scrollToWidget scrolls the layout to ensure that the given widget is in view. |
| 284 | // It returns whether scrolling was needed. |
no test coverage detected