UI: UIList Hover Highlighting #104677

Closed
Harley Acheson wants to merge 1 commits from Harley:UIListHover into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

Show highlight when hovering rows in UILists


This adds a highlight when hovering over items in UILists. It works in both list mode and preview tile mode:

ListHover1.gif

It also works correctly when hovering over list-row nested buttons:

ListHover2.gif

Show highlight when hovering rows in UILists --- This adds a highlight when hovering over items in UILists. It works in both list mode and preview tile mode: ![ListHover1.gif](/attachments/2c37f567-b5cf-4653-864d-4a83ea07791e) It also works correctly when hovering over list-row nested buttons: ![ListHover2.gif](/attachments/19e76a48-827b-4473-a3fd-fc32dfc311bc)
Brecht Van Lommel requested changes 2023-02-13 08:50:19 +01:00
Brecht Van Lommel left a comment
Owner

Behavior looks fine to me.

Behavior looks fine to me.
@ -11277,6 +11277,19 @@ static int ui_region_handler(bContext *C, const wmEvent *event, void * /*userdat
uiBut *but = ui_region_find_active_but(region);
uiBut *listbox = ui_list_find_mouse_over(region, event);
LISTBASE_FOREACH (uiBlock *, block, &region->uiblocks) {

What does this code do, and why is it here?

This is the main handler for UI input events, logic for handling some specific type of UI button I would expect to be near other code implementing that type.

Of course our UI code is weak and sometimes hacks are needed, but would like to see if this is really necessary.

What does this code do, and why is it here? This is the main handler for UI input events, logic for handling some specific type of UI button I would expect to be near other code implementing that type. Of course our UI code is weak and sometimes hacks are needed, but would like to see if this is really necessary.
Author
Member

That bit of code was almost identical to code that was called later in that function - ui_handle_view_items_hover, which removes any already-highlighted view items and then adds just the one being hovered. But the stuff I added was specific to UILists instead.

But I don't like that it was confusing. Or that there was this block of code for one thing, but a function for another. So I altered ui_handle_view_items_hover to handle both views and uilists and then renamed the function.

It is definitaly less confusing this way, but the patch looks messier - especially the way it is shown here.

That bit of code was almost identical to code that was called later in that function - `ui_handle_view_items_hover`, which removes any already-highlighted view items and then adds just the one being hovered. But the stuff I added was specific to UILists instead. But I don't like that it was confusing. Or that there was this block of code for one thing, but a function for another. So I altered `ui_handle_view_items_hover` to handle both views and uilists and then renamed the function. It is definitaly less confusing this way, but the patch looks messier - especially the way it is shown here.
brecht marked this conversation as resolved
Brecht Van Lommel added this to the User Interface project 2023-02-13 09:06:29 +01:00
Brecht Van Lommel approved these changes 2023-02-13 22:43:02 +01:00
Brecht Van Lommel left a comment
Owner

Thanks, this is much easier to understand now that it's just the same thing for one more button type.

Thanks, this is much easier to understand now that it's just the same thing for one more button type.

Let's try kicking the merge conflict check with close and reopen.

Let's try kicking the merge conflict check with close and reopen.
Brecht Van Lommel reopened this pull request 2023-02-20 10:44:31 +01:00
Author
Member

@blender-bot build

@blender-bot build
Author
Member

@blender-bot build

@blender-bot build

This needs to be rebased or merged with main, as there were some buildbot changes requiring this.

This needs to be rebased or merged with main, as there were some buildbot changes requiring this.
Harley Acheson force-pushed UIListHover from 1a220fcd0c to fbc3acb7df 2023-02-21 20:56:52 +01:00 Compare
Author
Member

@blender-bot build

@blender-bot build
Author
Member

Manual commit. Closing with 7216eb8879

Manual commit. Closing with https://projects.blender.org/blender/blender/commit/7216eb88797c8b268a8b6817c54caee2efdf71a1
Harley Acheson closed this pull request 2023-02-21 22:09:23 +01:00
First-time contributor

Pen tablets friendly popover lists scroll is still highly anticipated 😭

Pen tablets friendly popover lists scroll is still highly anticipated 😭
Harley Acheson deleted branch UIListHover 2023-02-22 17:09:01 +01:00
All checks were successful
buildbot/vexp-code-patch-coordinator Build done.

Pull request closed

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
3 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#104677
No description provided.