Follow focus if overlay status of the nodes matches

This commit is contained in:
Francisco Vallarino 2021-03-02 15:05:51 -03:00
parent 6e4cad7218
commit 24e99ec311
2 changed files with 4 additions and 1 deletions

View File

@ -275,8 +275,9 @@ makeScroll config state = widget where
focusInst = widgetFindByPath (node ^. L.widget) wenv focusPath node
focusVp = focusInst ^? _Just . L.viewport
focusOverlay = focusInst ^? _Just . L.overlay == Just True
overlayMatch = focusOverlay == node ^. L.info . L.overlay
result
| follow && not focusOverlay = focusVp >>= scrollTo wenv node
| follow && overlayMatch = focusVp >>= scrollTo wenv node
| otherwise = Nothing
ButtonAction point btn status _ -> result where
leftPressed = status == PressedBtn && btn == wenv ^. L.mainButton

View File

@ -542,6 +542,7 @@
- Fix books labels
- Check if using WidgetId in MoveFocus and SetFocus is possible
- Auto scroll affects dropdown when listView is displayed
- Ignore overlays if scroll is not an overlay
- Pending
- Add header in all files, indicating license and documenting what the module does
@ -556,6 +557,7 @@ Next
- Validate nested structures update correctly when disabling/enabling parent
- Something of generative art (OpenGL example)
- Send message to scroll to reset position when content changes
- Also scroll to focused element on init
- This is for listView. Maybe a config argument is needed, since this is not always desired?
Future