Fix #109439: Use List Item widget colors for View Item widgets #111584

Merged
Harley Acheson merged 3 commits from Rawalanche/blender:fix-view-item-use-list-item into main 2023-09-01 20:02:27 +02:00
Contributor

As concluded in discussion under #109439, the View Item widgets are
supposed to use List Item widget theme colors. This patch does that.


This PR consolidates drawing of ViewItem and ListItem, so they use the same drawing routines and colors. Some theme changes made to ListItem so that hovering works as expected in both ListItem and ViewItem.

As concluded in discussion under #109439, the View Item widgets are supposed to use List Item widget theme colors. This patch does that. --- This PR consolidates drawing of ViewItem and ListItem, so they use the same drawing routines and colors. Some theme changes made to ListItem so that hovering works as expected in both ListItem and ViewItem.
Ludvik Koutny added 1 commit 2023-08-27 12:12:11 +02:00
Iliya Katushenock added this to the User Interface project 2023-08-27 14:49:03 +02:00
Iliya Katushenock added the
Interest
Geometry Nodes
label 2023-08-27 14:49:10 +02:00
Member

If viewItem uses listItem colors then we'll have to consolidate those two theme categories. Following shows a capture of the default colors of these areas:

image

AFAIK there are only two differences between "Data-View Item" and "List Item" colors:

"Selected" color for "Data-View Item" is the blue highlight color, while "List Item" is a darkish grey. We'll want to use the one from "Data-View Item". That would require a change to userdef_default_theme.c wcol_list_item inner_sel. But we'd also have to version this somehow so that returning users get the proper highlight color. I think the best way to approach this in a way that works with all possibilities is to copy the inner_sel from wcol_menu_item (yes, "Menu Item") in versioning_userdef.cc in a version bump.

There is a difference in the way that listiem and viewItem blend colors for mouse hover highlighting. ListItem has an "inner" color that is dark but has an alpha of zero and hovers just fine. viewItem though has an inner with a solid alpha. If viewItem has the same inner as current listItem with zero alpha then it doesn't show a hover color. I haven't looked at the code there but guessing we'll have to change how viewItem does it to match listitem (or vice versa if one makes more sense).

I'll try to take a more detailed look into this in the next couple days.

If viewItem uses listItem colors then we'll have to consolidate those two theme categories. Following shows a capture of the default colors of these areas: ![image](/attachments/9b7ec31c-cdc6-4c78-abb6-65437c1e37ac) AFAIK there are only two differences between "Data-View Item" and "List Item" colors: "Selected" color for "Data-View Item" is the blue highlight color, while "List Item" is a darkish grey. We'll want to use the one from "Data-View Item". That would require a change to `userdef_default_theme.c` `wcol_list_item` `inner_sel`. But we'd also have to version this somehow so that returning users get the proper highlight color. I think the best way to approach this in a way that works with all possibilities is to copy the `inner_sel` from wcol_menu_item (yes, "**Menu** Item") in `versioning_userdef.cc` in a version bump. There is a difference in the way that listiem and viewItem blend colors for mouse hover highlighting. ListItem has an "inner" color that is dark but has an alpha of zero and hovers just fine. viewItem though has an inner with a solid alpha. If viewItem has the same inner as current listItem with zero alpha then it doesn't show a hover color. I haven't looked at the code there but guessing we'll have to change how viewItem does it to match listitem (or vice versa if one makes more sense). I'll try to take a more detailed look into this in the next couple days.
Member

Digging deeper, currently listItem and ViewItem draw a little differently, with the former using widget_list_itembut and the latter using widget_view_item.

There is a big difference for hover highlighting. With widget_view_item the viewItem ends up using wcol->inner for hover, which is different from everything else. We normally only use inner for the normal, unselected, unhovered background color of the item. This means that if ViewItem starts using ListItem's color you won't get hover highlighting because ListItem uses an inner with zero opacity.

So if we are going to do the change we expect, then we'd have to make these two things draw the same way. So in interface_widgets.cc we'd need to change UI_WTYPE_VIEW_ITEM so that its wt.draw is widget_list_itembut and then we can just remove widget_view_item. With that change then it will do hover when it uses the ListItem inner with zero opacity.

Digging deeper, currently listItem and ViewItem draw a little differently, with the former using `widget_list_itembut` and the latter using `widget_view_item`. There is a big difference for hover highlighting. With `widget_view_item` the viewItem ends up using wcol->inner for hover, which is different from everything else. We normally only use inner for the normal, unselected, unhovered background color of the item. This means that if ViewItem starts using ListItem's color you won't get hover highlighting because ListItem uses an inner with zero opacity. So if we are going to do the change we expect, then we'd have to make these two things draw the same way. So in `interface_widgets.cc` we'd need to change UI_WTYPE_VIEW_ITEM so that its wt.draw is `widget_list_itembut` and then we can just remove widget_view_item. With that change then it will do hover when it uses the ListItem inner with zero opacity.
Harley Acheson requested review from Harley Acheson 2023-09-01 18:21:17 +02:00
Harley Acheson added 1 commit 2023-09-01 18:54:22 +02:00
Harley Acheson added 1 commit 2023-09-01 19:39:53 +02:00
Harley Acheson approved these changes 2023-09-01 20:00:51 +02:00
Harley Acheson merged commit 0e090369d6 into main 2023-09-01 20:02:27 +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#111584
No description provided.