UI: Add scroll to sidebar tabs #105355
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#105355
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "guishe/blender:category-tab-scroll"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:
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
.Amazing to see this fix again. It works as one would expect, here's a video showing how it looks.
Thanks for working on it!
@ -483,2 +510,4 @@
}
wmWindow *win = CTX_wm_window(C);
wmEvent *event = win->event_last_handled;
Use
win->eventstate
,win->event_last_handled
is intended for event handling logic and not to be used by interface logic. Updated the doc-string to note this09ba0210d9
.Solved, the problem I had is that
mval
is not assigned inwin->eventstate
for 'Wheel Up/Down' events.@ -196,6 +206,21 @@ static int view_pan_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
inline bool mouse_in_category_tab(const ARegion *region, const wmEvent *event)
I don't see a point in using
inline
here, this is not a performance sensitive code path, so I rather don't optimize prematurely and let the compiler figure things out.19509af027
to721e1b0084
@ -2256,3 +2245,3 @@
if (LIKELY(category)) {
PanelCategoryDyn *pc_dyn = UI_panel_category_find(region, category);
if (LIKELY(pc_dyn)) {
if (LIKELY(pc_dyn) && (event->modifier & KM_CTRL)) {
Include a comment for shy checking CTRL is needed, also shouldn't this check
event->modifier == KM_CTRL
(so other modifier combinations are ignored).@ -196,6 +206,21 @@ static int view_pan_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
Use
ED_region_panel_category_gutter_isect_xy
or add a new public utility function toarea_query.c
if existing functions cannot be used - with an explanation for how it differs from existing intersection checking functions.It works, can I just assume that
win->eventstate
is never null?Yes, you can assume it's never NULL (the doc-string should be updated to note this).
@ -455,6 +455,9 @@ typedef struct ARegion {
rcti drawrct;
/** Size. */
short winx, winy;
/** Scroll value for category tab. */
Doc-string should state what unit this is in.
Also, is it scaled by DPI - does it properly handle changes (loading other peoples files with Hi-DPI?).
@ -1405,14 +1400,13 @@ void UI_panel_category_draw_all(ARegion *region, const char *category_id_active)
LISTBASE_FOREACH (PanelCategoryDyn *, pc_dyn, ®ion->panels_category) {
const rcti *rct = &pc_dyn->rect;
const bool is_visible = rct->ymin < v2d->mask.ymax && rct->ymax > v2d->mask.ymin;
Couldn't this be more efficient?
Works fine!
Something to consider is how the scroll position is handled across modes.
Edit-mode for example may show many tabs, the user may scroll to the bottom.
Do we consider it a problem if toggling edit-mode (for e.g.) resets the scroll position?
I think it's acceptable since we do that already in other vertical tabs layout like the Properties Editor's navigation bar, or even the editor itself.
If a solution for the navigation bar's scroll comes up it could be applied here, but that would probably be a separate patch that fixes both.
ae62c60f4d
to9478a4d45d
9478a4d45d
toe94fbaa5cf
e94fbaa5cf
toc48c4b090c