Panel 'HIDE_HEADER' option collapses right margin making scrolling difficult #95142

Open
opened 2022-01-22 19:10:07 +01:00 by eldee smith · 7 comments

System Information
Operating system: Windows-10-10.0.19043-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 472.39

Blender Version
Broken: version: 3.1.0 Alpha, branch: master, commit date: 2021-12-26 20:08, hash: 20b438d523
Worked: (newest version of Blender that worked as expected)

Short description of error
When using the HIDE_HEADER option, the right margin of the panel collapses, which causes the scrollbar to appear on top of content. Most noticeable with UILists that have small right-hand-side buttons (such as a list of materials with add/remove buttons).

Exact steps for others to reproduce the error
Run the included min-repro script and observe the issue in the VIEW_3D panel.

With HIDE_HEADER:
image.png

Without HIDE_HEADER:
image.png

import bpy


class HeaderBugPanel(bpy.types.Panel):
    bl_category = "TEST"
    bl_label = "Header Bug"
    bl_idname = "OBJECT_PT_header_bug"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_options = {'HIDE_HEADER'}

    def draw(self, context):
        layout = self.layout
        col = layout.column(align=True)
        col.label(text="This bug isn't very obvious unless you")
        col.label(text="have enough content to activate the scrollbar.")
        col.separator()
        col.label(text="With HIDE_HEADER the right margin is collapsed")
        col.label(text="and the scollbar will appear on top of content")
        col.label(text="making clicking on buttons and fields very")
        col.label(text="difficult. For example:")
        col.separator()
        row = layout.row(align=True)
        row.operator('object.select_all', text="Button 1").action='SELECT'
        row.operator('object.select_all', text="Button 2").action='SELECT'
        row.operator('object.select_all', text="Button 3").action='SELECT'
        row.operator('object.select_all', text="Button 4").action='SELECT'
        row.operator('object.select_all', text="Button 5").action='SELECT'
        
        col = layout.column(align=True)
        col.label(text="Working with a UIList with small right-side buttons")
        col.label(text="is virtually impossible:")
        
        
        ob = context.active_object

        if ob:
            is_sortable = len(ob.material_slots) > 1
            rows = 3
            if is_sortable:
                rows = 5

            row = layout.row()

            row.template_list("MATERIAL_UL_matslots", "", ob, "material_slots", ob, "active_material_index", rows=rows)

            col = row.column(align=True)
            col.operator("object.material_slot_add", icon='ADD', text="")
            col.operator("object.material_slot_remove", icon='REMOVE', text="")

            col.separator()

            col.menu("MATERIAL_MT_context_menu", icon='DOWNARROW_HLT', text="")

            if is_sortable:
                col.separator()

                col.operator("object.material_slot_move", icon='TRIA_UP', text="").direction = 'UP'
                col.operator("object.material_slot_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
                
        
        layout.separator(factor=25)
        layout.label(text="more content to stretch the panel....")
        layout.separator(factor=25)
        layout.label(text="more content to stretch the panel...")
        layout.separator(factor=25)
        layout.label(text="more content to stretch the panel...")
        layout.separator(factor=25)
        layout.label(text="more content to stretch the panel...")
        layout.separator(factor=25)
        layout.label(text="more content to stretch the panel...")
        layout.separator(factor=25)
        layout.label(text="more content to stretch the panel...")



def register():
    bpy.utils.register_class(HeaderBugPanel)


def unregister():
    bpy.utils.unregister_class(HeaderBugPanel)


if __name__ == "__main__":
    register()

**System Information** Operating system: Windows-10-10.0.19043-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 472.39 **Blender Version** Broken: version: 3.1.0 Alpha, branch: master, commit date: 2021-12-26 20:08, hash: `20b438d523` Worked: (newest version of Blender that worked as expected) **Short description of error** When using the HIDE_HEADER option, the right margin of the panel collapses, which causes the scrollbar to appear on top of content. Most noticeable with UILists that have small right-hand-side buttons (such as a list of materials with add/remove buttons). **Exact steps for others to reproduce the error** Run the included min-repro script and observe the issue in the VIEW_3D panel. With HIDE_HEADER: ![image.png](https://archive.blender.org/developer/F12816874/image.png) Without HIDE_HEADER: ![image.png](https://archive.blender.org/developer/F12816877/image.png) ``` import bpy class HeaderBugPanel(bpy.types.Panel): bl_category = "TEST" bl_label = "Header Bug" bl_idname = "OBJECT_PT_header_bug" bl_space_type = 'VIEW_3D' bl_region_type = 'UI' bl_options = {'HIDE_HEADER'} def draw(self, context): layout = self.layout col = layout.column(align=True) col.label(text="This bug isn't very obvious unless you") col.label(text="have enough content to activate the scrollbar.") col.separator() col.label(text="With HIDE_HEADER the right margin is collapsed") col.label(text="and the scollbar will appear on top of content") col.label(text="making clicking on buttons and fields very") col.label(text="difficult. For example:") col.separator() row = layout.row(align=True) row.operator('object.select_all', text="Button 1").action='SELECT' row.operator('object.select_all', text="Button 2").action='SELECT' row.operator('object.select_all', text="Button 3").action='SELECT' row.operator('object.select_all', text="Button 4").action='SELECT' row.operator('object.select_all', text="Button 5").action='SELECT' col = layout.column(align=True) col.label(text="Working with a UIList with small right-side buttons") col.label(text="is virtually impossible:") ob = context.active_object if ob: is_sortable = len(ob.material_slots) > 1 rows = 3 if is_sortable: rows = 5 row = layout.row() row.template_list("MATERIAL_UL_matslots", "", ob, "material_slots", ob, "active_material_index", rows=rows) col = row.column(align=True) col.operator("object.material_slot_add", icon='ADD', text="") col.operator("object.material_slot_remove", icon='REMOVE', text="") col.separator() col.menu("MATERIAL_MT_context_menu", icon='DOWNARROW_HLT', text="") if is_sortable: col.separator() col.operator("object.material_slot_move", icon='TRIA_UP', text="").direction = 'UP' col.operator("object.material_slot_move", icon='TRIA_DOWN', text="").direction = 'DOWN' layout.separator(factor=25) layout.label(text="more content to stretch the panel....") layout.separator(factor=25) layout.label(text="more content to stretch the panel...") layout.separator(factor=25) layout.label(text="more content to stretch the panel...") layout.separator(factor=25) layout.label(text="more content to stretch the panel...") layout.separator(factor=25) layout.label(text="more content to stretch the panel...") layout.separator(factor=25) layout.label(text="more content to stretch the panel...") def register(): bpy.utils.register_class(HeaderBugPanel) def unregister(): bpy.utils.unregister_class(HeaderBugPanel) if __name__ == "__main__": register() ```
Author

Added subscriber: @testure

Added subscriber: @testure
Author

Added subscriber: @Harley

Added subscriber: @Harley
Author

Seems like something @Harley might be interested in.

Seems like something @Harley might be interested in.
Member

@testure - Seems like something @Harley might be interested in.

I'm personally inclined to continue to ignore some of the mess of those panels for now. Maybe make D6505: UI: Scrollbar Behavior Changes a target for early in 3.2 (a week or two from now), then tackle whatever scrollbar issues remain after that. We have had quite broad consensus for D6505 but the current organization of the UI Module has made it a bit harder to plan targets lately. I'll keep trying for that though.

> @testure - Seems like something @Harley might be interested in. I'm personally inclined to continue to ignore some of the mess of those panels for now. Maybe make [D6505: UI: Scrollbar Behavior Changes](https://archive.blender.org/developer/D6505) a target for early in 3.2 (a week or two from now), then tackle whatever scrollbar issues remain after that. We have had quite broad consensus for [D6505](https://archive.blender.org/developer/D6505) but the current organization of the UI Module has made it a bit harder to plan targets lately. I'll keep trying for that though.

Added subscriber: @deadpin

Added subscriber: @deadpin

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

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

Will confirm for now since I can reproduce and there's not an immediately obvious existing bug to dup this to.

Will confirm for now since I can reproduce and there's not an immediately obvious existing bug to dup this to.
Philipp Oeser removed the
Interest
User Interface
label 2023-02-10 09:22:16 +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
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#95142
No description provided.