WIP: UI: TreeView Item Drag Padding #111032
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#111032
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Harley/blender:TreeDragPadding"
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?
Eliminates the "no drop" zones between TreeView list items
Marked as WIP because this might not be the solution, but just an identification of the problem. When dragging TreeView items we get a bad result between the items: the mouse cursor changes to a "stopsign" and the tooltip hint is removed.
In a nutshell the space between the items returns false for the ui_view_drop_poll. This is because ui_handle_viewlist_items_hover calls ui_list_row_find_mouse_over which calls ui_but_find_mouse_over_ex, which uses the button's bounds for the hit calculation.
This fixes that by adding a specific test for UI_BTYPE_LISTROW & UI_BTYPE_VIEW_ITEM which adds padding. This allows it to pass the ui_view_drop_poll and we no longer get the stopsign cursor. However the tooltip then says "View Drop" between the items, which is fixed by also adding padding in AbstractTreeViewItem::get_win_rect.
Note that I have not actually found the define for the item gap size, and am just guessing with
2.0f * U.pixelsize
.WIP: TreeView Item Drag Paddingto WIP: UI: TreeView Item Drag PaddingThat's what I was thinking to make a Right-Click select request to have an "indicator" when it comes to drag-and-drop the layer in-between to avoid the ordering confusion. Something like you can do in Inkscape for example.
(Think the gap size comes from
uiStyle.buttonspacey
.)Adding padding takes away space from the view drop area. Views can also have a drop-target (not just view items) so dropping in empty space of the view also works (the light linking UI uses this, and will use view item drop-targets in future too).
Did you look into what I proposed, increasing the row height slightly and using a layout with alignment enabled? That would properly increase the item size without post-processing rectangles locally in a way that can cause discrepancies/conflicts with other UI handling code.
I can confirm that the dragging operation looks great with just the following change...
However, I (have so far) not found a way to also have the wider line spacing that you prefer. We end up with a tighter spacing of the rows:
Committed
427bdc8dcf
. This makes sure there won't be discrepancies between the rectangle used by the tree view (e.g. for dropping, but also possibly other things) and the one used for handling etc. It removes the gap (by enabling alignment in the layout), scales up the view item to avoid a crammed look, but scales down the highlights to use the regular widget height.This is not needed with
427bdc8dcf
Pull request closed