UI: Add scroll to sidebar tabs #105355

Merged
Pablo Vazquez merged 3 commits from guishe/blender:category-tab-scroll into main 2023-03-15 16:45:21 +01:00

3 Commits

Author SHA1 Message Date
Guillermo Venegas c48c4b090c Added required comments and fixed existing ones.
Mouse_in_category_tab is replaced with the
ED_region_panel_category_gutter_isect_xy method.

The drawing of the category panels is optimized
2023-03-15 16:36:15 +01:00
guishe 942bbee135 Fix: Use windows->eventstate and remove the inline specifier
Use `win→eventstate` instead of `win→event_last_handled`. Note: The mouse
position relative to the region must be calculated because in `Wheel Up/Down`
events `mval` is unassigned.

The `inline` specifier used in `mouse_in_category_tab` is also removed.
2023-03-15 16:36:15 +01:00
guishe 2675f00b3c UI: Add scroll to sidebar tabs
When the height of the editor couldn’t fit the sidebar tabs, they would shrink
to a minimum size that made it impossible to read the tab labels.

This pull request matches the behaviour with the Properties Editor navigation
bar, by introducing the following improvements:
* Avoid truncating tab labels.
* Allow scrolling when tabs don’t fit.

Behaviour is similar to how scrolling works in the Properties Editor navigation
bar, supporting mouse wheel up/down and MMB, and switching tabs with
`Ctrl+Wheel Up/Down`.
2023-03-15 16:36:15 +01:00