Blender Git Commit Log

Git Commits -> Revision 0c83ef5

Revision 0c83ef5 by Julian Eisel (master)
July 15, 2021, 14:12 (GMT)
UI: Auto-scroll to keep active text buttons in view

If a text button is activated that is not in view (i.e. scrolled away),
the scrolling will now be adjusted to have it in view (with some
small additional margin). While entering text, the view may also be
updated should the button move out of view, for whatever reason. For the
most part, this feature shouldn't be needed and won't kick in, except
when a clicked on text button is partially out of view or very close to
the region edge. It's however quite important for the previously
committed feature, that is, pressing Ctrl+F to start searching in a UI
list. The end of the list where the scroll button appears may not be in
view. Plus while filtering the number of visible items changes so the
scrolling has to be updated to keep the search button visible.

Note that I disabled the auto-scrolling for when the text button spawned
an additional popup, like for search-box buttons. That is because
current code assumes the button to have a fixed position while the popup
is open. There is no code to update the popup position together with the
button/scrolling.

I also think that the logic added here could be used in more places,
e.g. for the "ensure file in view" logic the File Browser does.

Commit Details:

Full Hash: 0c83ef567c503abf1e8305062fc8b3e7de17b257
Parent Commit: 89fd3af
Committed By: Sybren A. Stüvel
Lines Changed: +189, -11

7 Modified Paths:

/source/blender/editors/include/UI_interface.h (+3, -0) (Diff)
/source/blender/editors/interface/interface.c (+37, -7) (Diff)
/source/blender/editors/interface/interface_handlers.c (+25, -0) (Diff)
/source/blender/editors/interface/interface_intern.h (+12, -0) (Diff)
/source/blender/editors/interface/interface_query.c (+14, -4) (Diff)
/source/blender/editors/interface/interface_utils.c (+96, -0) (Diff)
/source/blender/editors/screen/area.c (+2, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021