parentScrollFrame returns the first parent frame that has active scrollbars.
()
| 256 | |
| 257 | // parentScrollFrame returns the first parent frame that has active scrollbars. |
| 258 | func (wb *WidgetBase) parentScrollFrame() *Frame { |
| 259 | ly := tree.ParentByType[Layouter](wb) |
| 260 | if ly == nil { |
| 261 | return nil |
| 262 | } |
| 263 | fr := ly.AsFrame() |
| 264 | if fr.hasAnyScroll() { |
| 265 | return fr |
| 266 | } |
| 267 | return fr.parentScrollFrame() |
| 268 | } |
| 269 | |
| 270 | // ScrollToThis tells this widget's parent frame to scroll to keep |
| 271 | // this widget in view. It returns whether any scrolling was done. |
no test coverage detected