list items in properties editor #35750

Closed
opened 2013-06-14 15:10:01 +02:00 by Cezary Kopias · 16 comments

%%%--- Operating System, Graphics card ---

- Blender version with error, and version that worked ---


- Short description of error ---

properties list items ( like vertex groups list ) dont use interface theme list items text colors

- Steps for others to reproduce the error (preferably based on attached .blend file) ---

see attached image
%%%

%%%--- Operating System, Graphics card --- - Blender version with error, and version that worked --- - Short description of error --- properties list items ( like vertex groups list ) dont use interface theme list items text colors - Steps for others to reproduce the error (preferably based on attached .blend file) --- see attached image %%%
Author

Changed status to: 'Open'

Changed status to: 'Open'

%%%Dev note:
In interface_templates.c in uiTemplateList()
some of the "layout_type" cases define a custom but and pass over the "LISTROW" type, so the list theme works, others use a draw_item(). %%%

%%%Dev note: In interface_templates.c in uiTemplateList() some of the "layout_type" cases define a custom but and pass over the "LISTROW" type, so the list theme works, others use a draw_item(). %%%
Member

%%%Assign to self!%%%

%%%Assign to self!%%%
Member

%%%I move it to Brecht's desk. He coded most of it, might now smarter solutions.

Currently, the only lists in Blender respecting theme color for "List Item" is when it gets defined entirely as LISTROW button. That's in File Select editor now.

In the uiTemplateList() code however, the button gets a NULL icon, and a "" string. This then gets added as LABEL type later.

I wonder if the itemL() function could somehow find out it's a member of a list via layout? Python defined lists then would go OK too;.%%%

%%%I move it to Brecht's desk. He coded most of it, might now smarter solutions. Currently, the only lists in Blender respecting theme color for "List Item" is when it gets defined entirely as LISTROW button. That's in File Select editor now. In the uiTemplateList() code however, the button gets a NULL icon, and a "" string. This then gets added as LABEL type later. I wonder if the itemL() function could somehow find out it's a member of a list via layout? Python defined lists then would go OK too;.%%%

%%%Proposed patch: http://www.pasteall.org/43485

See also mail http://lists.blender.org/pipermail/bf-committers/2013-June/040970.html%%%

%%%Proposed patch: http://www.pasteall.org/43485 See also mail http://lists.blender.org/pipermail/bf-committers/2013-June/040970.html%%%

%%%That's quite a few hacks, wouldn't adding a LISTLABEL type make the code cleaner?%%%

%%%That's quite a few hacks, wouldn't adding a LISTLABEL type make the code cleaner?%%%

%%%Yes… but it would mean the need to expose it to python (through RNA ui api , probably as an option to layout.label), and the need for all python uiList classes to use it instead of usual label… not straight forward for addons programmers. While current solution is hackish, but fully under the hood (i.e. end UI api user has nothing to do).

So I’d say it’s a trade-off, between something not-that-nice but which does not need any changes to actual UI code, and something cleaner but modifying the UI API (in a somewhat strange way, "use this option only inside list item draw functions").%%%

%%%Yes… but it would mean the need to expose it to python (through RNA ui api , probably as an option to layout.label), and the need for all python uiList classes to use it instead of usual label… not straight forward for addons programmers. While current solution is hackish, but fully under the hood (i.e. end UI api user has nothing to do). So I’d say it’s a trade-off, between something not-that-nice but which does not need any changes to actual UI code, and something cleaner but modifying the UI API (in a somewhat strange way, "use this option only inside list item draw functions").%%%

%%%This is "only" a UI theme color bug, rather not introduce too many hacks for that.%%%

%%%This is "only" a UI theme color bug, rather not introduce too many hacks for that.%%%

%%%Ah, I wasn't suggesting to expose this to python, just to change the type of the labels inside the list automatically to a LISTLABEL (either changing but->type afterwards or doing it in uiItemL if a list is being created).%%%

%%%Ah, I wasn't suggesting to expose this to python, just to change the type of the labels inside the list automatically to a LISTLABEL (either changing but->type afterwards or doing it in uiItemL if a list is being created).%%%

%%%Ah, ok, yes, that would avoid abusing UI_BUT_COLOR_LOCK at least… Working on it.%%%

%%%Ah, ok, yes, that would avoid abusing UI_BUT_COLOR_LOCK at least… Working on it.%%%

%%%Updated patch: http://www.pasteall.org/43496/diff

Compared to previous one, had to edit handler code too to take into account new button type.

Note I completely removed widget_state_label(), it actually does nothing more than widget_state (i.e. use text colors from default color set), afaict.%%%

%%%Updated patch: http://www.pasteall.org/43496/diff Compared to previous one, had to edit handler code too to take into account new button type. Note I completely removed widget_state_label(), it actually does nothing more than widget_state (i.e. use text colors from default color set), afaict.%%%
Author

%%%Could the same code be used to display those things? Could someone can explain this case?%%%

%%%Could the same code be used to display those things? Could someone can explain this case?%%%

%%%Bastien: patch looks good to me know. Only thing I would change still is to replace the do / while loop with a simple for loop. Probably it works fine the way this function is called here but no need to introduce the risk of a NULL pointer access for the first item.

Czarek, I don't understand the question? This code is a fix for the bug so that it uses the theme colors for list items, it will be committed to the Blender code soon.%%%

%%%Bastien: patch looks good to me know. Only thing I would change still is to replace the do / while loop with a simple for loop. Probably it works fine the way this function is called here but no need to introduce the risk of a NULL pointer access for the first item. Czarek, I don't understand the question? This code is a fix for the bug so that it uses the theme colors for list items, it will be committed to the Blender code soon.%%%
Author

%%%Brecht, never mind i will read the code.
By the way i found another:

option ui elements in F6 after operator box use 3d view "Theme space Settings Text Highlight" color

attaching image%%%

%%%Brecht, never mind i will read the code. By the way i found another: option ui elements in F6 after operator box use 3d view "Theme space Settings Text Highlight" color attaching image%%%

%%%Fixed in r57760, thanks for the report.

@ Czarek: Please open a new bug report, easier to track this way…%%%

%%%Fixed in r57760, thanks for the report. @ Czarek: Please open a new bug report, easier to track this way…%%%

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
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
5 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#35750
No description provided.