Wrong layout alignment #50756

Closed
opened 2017-02-22 18:42:13 +01:00 by Vincent Girès · 8 comments

System Information
Win10 / GTX 1070

Blender Version
Broken: 2.78

Short description of error
I'm not sure we can consider it as a bug, but the layout alignment doesn't seems to be correct in all situations.
A simple example with row and column can show what seems wrong.

layout = self.layout
col = layout.column(align=True)
row = col.row(align=True)
row.prop(scene, 'prop_a')
row.operator('my_operator.btn')
col.prop(scene, 'prop_b')

Exact steps for others to reproduce the error
Run the script in the attached .blend file and check the result in the sequencer panel.

bug_report_layout_align.png
bug_report_layout_align.blend
layout_not_aligned.png

**System Information** Win10 / GTX 1070 **Blender Version** Broken: 2.78 **Short description of error** I'm not sure we can consider it as a bug, but the layout alignment doesn't seems to be correct in all situations. A simple example with row and column can show what seems wrong. layout = self.layout col = layout.column(align=True) row = col.row(align=True) row.prop(scene, 'prop_a') row.operator('my_operator.btn') col.prop(scene, 'prop_b') **Exact steps for others to reproduce the error** Run the script in the attached .blend file and check the result in the sequencer panel. ![bug_report_layout_align.png](https://archive.blender.org/developer/F493841/bug_report_layout_align.png) [bug_report_layout_align.blend](https://archive.blender.org/developer/F493843/bug_report_layout_align.blend) ![layout_not_aligned.png](https://archive.blender.org/developer/F493844/layout_not_aligned.png)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @VincentGires

Added subscriber: @VincentGires
Aleksandr Zinovev was assigned by Aaron Carlisle 2017-02-22 18:50:21 +01:00

[UILayout.row ]] is not enough in this case. You have to use [ https:*docs.blender.org/api/blender_python_api_2_77_0/bpy.types.UILayout.html#bpy.types.UILayout.split | UILayout.split :

        scene = context.scene
        layout = self.layout
        col = layout.column(align=True)
        row = col.split(0.3, align=True)
        row.label("Prop A")
        row = row.row(align=True)
        row.prop(scene, 'prop_a', "")
        row.operator('my_operator.btn')
        
        row = col.split(0.3, align=True)
        row.label("Prop B")
        row = row.row(align=True)
        row.prop(scene, 'prop_b', "")
        row.operator('my_operator.btn', text='', icon='REC')
        
        row = col.split(0.3, align=True)
        row.label("Prop C")
        row = row.row(align=True)
        row.prop(scene, 'prop_c', "")
        
        row = col.split(0.3, align=True)
        row.label("Prop D")
        row = row.row(align=True)
        row.prop(scene, 'prop_d', "")

Or use 2 columns instead of 1:


        scene = context.scene
        layout = self.layout
        row = layout.row(align=True)
        
        col1 = row.column(align=True)
        col2 = row.column(align=True)
        
        col1.label("Prop A")
        row = col2.row(align=True)
        row.prop(scene, 'prop_a', "")
        row.operator('my_operator.btn')
        
        col1.label("Prop B")
        row = col2.row(align=True)
        row.prop(scene, 'prop_b', "")
        row.operator('my_operator.btn', text='', icon='REC')
        
        col1.label("Prop C")
        row = col2.row(align=True)
        row.prop(scene, 'prop_c', "")
        
        col1.label("Prop D")
        row = col2.row(align=True)
        row.prop(scene, 'prop_d', "")
[UILayout.row ]] is not enough in this case. You have to use [[ https:*docs.blender.org/api/blender_python_api_2_77_0/bpy.types.UILayout.html#bpy.types.UILayout.split | UILayout.split ](https:*docs.blender.org/api/blender_python_api_2_77_0/bpy.types.UILayout.html#bpy.types.UILayout.row): ``` scene = context.scene layout = self.layout col = layout.column(align=True) row = col.split(0.3, align=True) row.label("Prop A") row = row.row(align=True) row.prop(scene, 'prop_a', "") row.operator('my_operator.btn') row = col.split(0.3, align=True) row.label("Prop B") row = row.row(align=True) row.prop(scene, 'prop_b', "") row.operator('my_operator.btn', text='', icon='REC') row = col.split(0.3, align=True) row.label("Prop C") row = row.row(align=True) row.prop(scene, 'prop_c', "") row = col.split(0.3, align=True) row.label("Prop D") row = row.row(align=True) row.prop(scene, 'prop_d', "") ``` Or use 2 columns instead of 1: ``` scene = context.scene layout = self.layout row = layout.row(align=True) col1 = row.column(align=True) col2 = row.column(align=True) col1.label("Prop A") row = col2.row(align=True) row.prop(scene, 'prop_a', "") row.operator('my_operator.btn') col1.label("Prop B") row = col2.row(align=True) row.prop(scene, 'prop_b', "") row.operator('my_operator.btn', text='', icon='REC') col1.label("Prop C") row = col2.row(align=True) row.prop(scene, 'prop_c', "") col1.label("Prop D") row = col2.row(align=True) row.prop(scene, 'prop_d', "") ```

Added subscriber: @AleksandrZinovev-2

Added subscriber: @AleksandrZinovev-2

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

There is indeed no bug here, as @AleksandrZinovev-2 already explained.

There is indeed no bug here, as @AleksandrZinovev-2 already explained.
Author

Oh sorry for the bad report!
And thank you for the answer :)

Oh sorry for the bad report! And thank you for the answer :)
Sign in to join this conversation.
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-addons#50756
No description provided.