UI: 'use_property_split' w/ right alignment cuts off property text #82477

Open
opened 2020-11-07 05:05:18 +01:00 by Ryan Inch · 13 comments
Member

System Information
Operating system: Linux-5.8.7-arch1-1-x86_64-with-arch 64 Bits
Graphics card: GeForce GTX 660M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 450.66

Blender Version
Broken: version: 2.91.0 Beta, branch: master, commit date: 2020-11-05 22:40, hash: 02677ec4e0
Broken: version: 2.90
Worked: 2.83

Short description of error
The text of properties gets cut off when defining a UILayout with use_property_split set to true and
alignment is set to something other than `EXPAND' for some layout types, e.g. rows.

Exact steps for others to reproduce the error

  • Install and enable the provided test addon.
  • Open the test panel in Properties > Scene

prop_text_bug_example.py

This is possibly a regression from 219049bb3b.

Note: the test addon uses a checkbox property, but the bug is also observable with whatever property type scene.background_set is.

{F9553881 size=full}

        layout = self.layout.row()
        layout.use_property_split = True
        layout.alignment = 'RIGHT'
        layout.prop(context.scene, "use_gravity")
**System Information** Operating system: Linux-5.8.7-arch1-1-x86_64-with-arch 64 Bits Graphics card: GeForce GTX 660M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 450.66 **Blender Version** Broken: version: 2.91.0 Beta, branch: master, commit date: 2020-11-05 22:40, hash: `02677ec4e0` Broken: version: 2.90 Worked: 2.83 **Short description of error** The text of properties gets cut off when defining a UILayout with `use_property_split` set to true and `alignment` is set to something other than `EXPAND' for some layout types, e.g. rows. **Exact steps for others to reproduce the error** * Install and enable the provided test addon. * Open the test panel in Properties > Scene [prop_text_bug_example.py](https://archive.blender.org/developer/F9224318/prop_text_bug_example.py) This is possibly a regression from 219049bb3b. Note: the test addon uses a checkbox property, but the bug is also observable with whatever property type `scene.background_set` is. {[F9553881](https://archive.blender.org/developer/F9553881/image.png) size=full} ``` layout = self.layout.row() layout.use_property_split = True layout.alignment = 'RIGHT' layout.prop(context.scene, "use_gravity") ```
Author
Member

Added subscriber: @Imaginer

Added subscriber: @Imaginer

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Added subscriber: @timodriaan

Added subscriber: @timodriaan
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Member

Personally I wouldn't call this a bug, what is right alignment supposed to do in property split situations anyway? I'm not sure we can expect the full feature-set of the layout system to work when property split is set, it would raise too many special cases and arbitrary design decisions.

I guess this will wait for someone else to come by and offer another opinion. Can't say that will be any time soon...

Thanks anyway for the report.

Personally I wouldn't call this a bug, what is right alignment supposed to do in property split situations anyway? I'm not sure we can expect the full feature-set of the layout system to work when property split is set, it would raise too many special cases and arbitrary design decisions. I guess this will wait for someone else to come by and offer another opinion. Can't say that will be any time soon... Thanks anyway for the report.
Campbell Barton changed title from Python: 'use_property_split' Cuts Off Property Text to UI: 'use_property_split' w/ right alignment cuts off property text 2021-01-08 02:39:54 +01:00

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Setting as paper-cut, as it could work better, but not a serious error in the code.

Setting as paper-cut, as it could work better, but not a serious error in the code.
Author
Member

@ideasman42 Just to be clear this is not limited to right alignment, but affects left and center alignment as well, i.e. it affects anything other than expand.

@ideasman42 Just to be clear this is not limited to right alignment, but affects left and center alignment as well, i.e. it affects anything other than expand.

Added subscriber: @jenkm

Added subscriber: @jenkm

I agree with Hans. But if there is some exceptional case when it is necessary then I do not see any problems to make such a layout.

lang=py
        col = layout.column(heading="Diffuse", align=True)

        col.prop(context.scene, "use_gravity")
        col.prop(context.scene, "use_gravity")

        sub = col.row()
        sub.alignment = 'RIGHT'
        sub.use_property_split = False
        sub.prop(context.scene, "use_gravity")

        col.prop(context.scene, "use_gravity")
        col.prop(context.scene, "use_gravity")

#82477.png

There are many cases where a split layout doesn't work perfectly and we just use some workarounds.
I think the split layout should only be used for what it was designed for.

I agree with Hans. But if there is some exceptional case when it is necessary then I do not see any problems to make such a layout. ``` lang=py col = layout.column(heading="Diffuse", align=True) col.prop(context.scene, "use_gravity") col.prop(context.scene, "use_gravity") sub = col.row() sub.alignment = 'RIGHT' sub.use_property_split = False sub.prop(context.scene, "use_gravity") col.prop(context.scene, "use_gravity") col.prop(context.scene, "use_gravity") ``` ![#82477.png](https://archive.blender.org/developer/F9555389/T82477.png) There are many cases where a split layout doesn't work perfectly and we just use some workarounds. I think the split layout should only be used for what it was designed for.
Author
Member

use_property_split is not well documented, so I'm not entirely sure what it is designed for, but I still see no reason why it should truncate labels to an arbitrary length when used in conjunction with a non-expand alignment. No other layout properties exhibit this behavior so I can only assume it is not intended.

use_property_split is not well documented, so I'm not entirely sure what it is designed for, but I still see no reason why it should truncate labels to an arbitrary length when used in conjunction with a non-expand alignment. No other layout properties exhibit this behavior so I can only assume it is not intended.
Member

It's because changing the alignment is a fundamentally different requirement than what property split was created for, which is a specific, more structured layout.

Property split creates two columns. One for labels and one for buttons. It's almost everywhere in the property editor.

The way property split works right now is quite hacky, so theoretically the layout in the right column could become more flexible.
The idea of a specific uiLayoutPropertySplitRow was proposed in the past, as a way to more explicitly hold the three sub-items: the label column, the buttons column, and the decorator column.

It's because changing the alignment is a fundamentally different requirement than what property split was created for, which is a specific, more structured layout. Property split creates two columns. One for labels and one for buttons. It's almost everywhere in the property editor. The way property split works right now is quite hacky, so theoretically the layout in the right column could become more flexible. The idea of a specific `uiLayoutPropertySplitRow` was proposed in the past, as a way to more explicitly hold the three sub-items: the label column, the buttons column, and the decorator column.
Author
Member

Thanks. That clears things up a lot.

Thanks. That clears things up a lot.
Philipp Oeser removed the
Interest
User Interface
label 2023-02-10 09:23:54 +01:00
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
6 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#82477
No description provided.