UI: Support page based scrolling in View2D #109154

Merged
Julian Eisel merged 3 commits from JulianEisel/blender:temp-view2d-page-scrolling into main 2023-07-03 15:15:25 +02:00
Member

No user visible changes expected. The feature is not exposed yet.

For the asset shelf (#102879), design is to use a paginated scrolling
style. That means, that any scrolling will always snap to a multiple of
the page size (the size used when pressing the Page Up/Down keys).
Together with strict region size snapping (implemented in the asset
shelf patch, #104831), this gives a clean scrolling experience where
partially visible rows are avoided (impossible even).

DPI scaling or thumbnail size changes work fine in #104831. Snapping
during zooming is not implemented, the asset-shelf doesn't need zooming.

Introduces:

  • View2D.flag value V2D_SNAP_TO_PAGESIZE_Y, which will cause any
    scrolling to only use multiples of the page size.
  • A custom page size via View2D.page_size_y for when the full region
    size is not the appropriate page size value.
  • API function UI_view2d_offset_y_snap_to_closest_page() to enforce
    the snapping from outside View2D. The asset shelf uses this to keep
    strict scrolling over DPI changes.

When scrolling with middle-mouse drag, a page is scrolled after half the
page size is dragged.

TODO:

  • Doesn't work well with touchpads & pen tablets yet.
No user visible changes expected. The feature is not exposed yet. For the asset shelf (#102879), design is to use a paginated scrolling style. That means, that any scrolling will always snap to a multiple of the page size (the size used when pressing the Page Up/Down keys). Together with strict region size snapping (implemented in the asset shelf patch, #104831), this gives a clean scrolling experience where partially visible rows are avoided (impossible even). <video src="https://projects.blender.org/attachments/4ba81c34-37e3-403d-99b2-5bfa561cb0d0" controls></video> DPI scaling or thumbnail size changes work fine in #104831. Snapping during zooming is not implemented, the asset-shelf doesn't need zooming. Introduces: - `View2D.flag` value `V2D_SNAP_TO_PAGESIZE_Y`, which will cause any scrolling to only use multiples of the page size. - A custom page size via `View2D.page_size_y` for when the full region size is not the appropriate page size value. - API function `UI_view2d_offset_y_snap_to_closest_page()` to enforce the snapping from outside View2D. The asset shelf uses this to keep strict scrolling over DPI changes. When scrolling with middle-mouse drag, a page is scrolled after half the page size is dragged. TODO: - Doesn't work well with touchpads & pen tablets yet.
Julian Eisel added 1 commit 2023-06-20 12:13:26 +02:00
df7cbec6ad UI: Support page based scrolling in View2D
No user visible changes expected.

For the asset shelf (#102879), design is to use a paginated scrolling
style. That means, that any scrolling will always snap to a multiple of
the page size (the size used when pressing the Page Up/Down keys).
Together with strict region size snapping (implemented in the asset
shelf patch, #104831), this gives a clean scrolling experience where
partially visible rows are avoided (impossible even).

DPI scaling or thumbnail size changes work fine in #104831. Snapping
during zooming is not implemented, the asset-shelf doesn't need zooming.

Introduces:
- `View2D.flag` value `V2D_SNAP_TO_PAGESIZE_Y`, which will cause any
  scrolling to only use multiples of the page size.
- A custom page size via `View2D.page_size_y` for when the full region
  size is not the appropriate page size value.
- API function `UI_view2d_offset_y_snap_to_closest_page()` to enforce
  the snapping from outside View2D. The asset shelf uses this to keep
  strict scrolling over DPI changes.

TODO:
- Doesn't work well with touchpads & pen tablets yet.
Julian Eisel added the
Module
User Interface
Interest
Asset Browser
labels 2023-06-20 12:14:15 +02:00
Julian Eisel added 1 commit 2023-06-23 11:31:10 +02:00
Campbell Barton approved these changes 2023-06-27 07:44:56 +02:00
Julian Eisel added 1 commit 2023-07-03 15:13:48 +02:00
Julian Eisel merged commit 0d1f3f445a into main 2023-07-03 15:15:25 +02:00
Julian Eisel deleted branch temp-view2d-page-scrolling 2023-07-03 15:15:26 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
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
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
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
EEVEE & Viewport
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
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
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
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#109154
No description provided.