UI: Add popup layout panels sub brackground color #119803

Open
Guillermo Venegas wants to merge 2 commits from guishe/blender:popup-layout-panel-color into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Contributor

Adds a user preference for setting popups layout panels sub background color


Redo region / Redo popup / WM_operator_props_dialog

Untitled

import bpy
from bpy.props import StringProperty, BoolProperty, EnumProperty


class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"
    bl_options = {'REGISTER', 'UNDO'}
    
    
    mesh: BoolProperty(name="Mesh")
    light: BoolProperty(name="Light")
    panel_open_state: BoolProperty(name="panel_open_state")
    
    @classmethod
    def poll(cls, context):
        return True

    def execute(self, context):
        return {'FINISHED'}

    def draw(self, context):
        layout = self.layout
        for x in range(5):
            header, layout = layout.panel(str(x), default_closed=False)
            text="Sub "*x+"Layout panel"
            header.label(text=text)
            if layout:
                layout.prop(self,"mesh")
                layout.prop(self,"light")
            else:
                return
            
            
    def invoke(self, context ,event):
        wm = context.window_manager
        return wm.invoke_props_dialog(self)



def menu_func(self, context):
    self.layout.operator(SimpleOperator.bl_idname, text=SimpleOperator.bl_label)

def register():
    bpy.utils.register_class(SimpleOperator)
    bpy.types.TOPBAR_MT_file.append(menu_func)

def unregister():
    bpy.utils.unregister_class(SimpleOperator)
    bpy.types.TOPBAR_MT_file.remove(menu_func)
    
register()




Adds a user preference for setting popups layout panels sub background color <hr> `Redo region` / `Redo popup` / `WM_operator_props_dialog` ![Untitled](/attachments/d6d65d27-b597-4a79-88bf-a622e5f89b38) <video src="/attachments/15872702-182e-407b-a71d-2b04d5025abb" title="2024-03-22 12-48-24.mp4" controls></video> ```python import bpy from bpy.props import StringProperty, BoolProperty, EnumProperty class SimpleOperator(bpy.types.Operator): """Tooltip""" bl_idname = "object.simple_operator" bl_label = "Simple Object Operator" bl_options = {'REGISTER', 'UNDO'} mesh: BoolProperty(name="Mesh") light: BoolProperty(name="Light") panel_open_state: BoolProperty(name="panel_open_state") @classmethod def poll(cls, context): return True def execute(self, context): return {'FINISHED'} def draw(self, context): layout = self.layout for x in range(5): header, layout = layout.panel(str(x), default_closed=False) text="Sub "*x+"Layout panel" header.label(text=text) if layout: layout.prop(self,"mesh") layout.prop(self,"light") else: return def invoke(self, context ,event): wm = context.window_manager return wm.invoke_props_dialog(self) def menu_func(self, context): self.layout.operator(SimpleOperator.bl_idname, text=SimpleOperator.bl_label) def register(): bpy.utils.register_class(SimpleOperator) bpy.types.TOPBAR_MT_file.append(menu_func) def unregister(): bpy.utils.unregister_class(SimpleOperator) bpy.types.TOPBAR_MT_file.remove(menu_func) register() ```
Guillermo Venegas added 1 commit 2024-03-22 19:54:26 +01:00
Guillermo Venegas requested review from Pablo Vazquez 2024-03-22 19:57:08 +01:00
Guillermo Venegas requested review from Harley Acheson 2024-03-22 19:57:09 +01:00
Guillermo Venegas added 1 commit 2024-03-22 20:06:32 +01:00

As far as the default colors go, we should try to align with the current panel colors. That means 2 things if possible:

  • The popup dialogs that get panel support should be drawn with Blender's "typical" panel header color first. Not the extremely dark black that happens today. This might be a large visual change though.

  • The "sub background" color, by default, should darken (instead of lighten) as you expand each sub panel.
    Darkening by default:
    darken-by-default.png

It would be best if this wasn't yet another color to control and instead it should just use the existing "sub background" color... but our theme system is a mess so I'm not sure where best to add this. The existing panel entries are defined 19 separate times for each major region e.g. Outliner->Theme Space->Panel colors then again for File/Asset Browser->Theme Space->Panel colors and so on :(
existing-theme-entries.png

As far as the default colors go, we should try to align with the current panel colors. That means 2 things if possible: - The popup dialogs that get panel support should be drawn with Blender's "typical" panel header color first. Not the extremely dark black that happens today. This might be a large visual change though. - The "sub background" color, by default, should darken (instead of lighten) as you expand each sub panel. Darkening by default: ![darken-by-default.png](/attachments/b23d2e19-1831-4759-bfc8-be1521b03af8) It would be best if this wasn't yet another color to control and instead it should just use the existing "sub background" color... but our theme system is a mess so I'm not sure where best to add this. The existing panel entries are defined 19 separate times for each major region e.g. `Outliner->Theme Space->Panel colors` then again for `File/Asset Browser->Theme Space->Panel colors` and so on :( ![existing-theme-entries.png](/attachments/68dea403-3429-4782-9003-ec9f623bf730)
Jesse Yurkovich added this to the User Interface project 2024-03-26 20:19:23 +01:00
This pull request has changes conflicting with the target branch.
  • source/blender/blenkernel/BKE_blender_version.h
  • source/blender/blenloader/intern/versioning_userdef.cc

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u popup-layout-panel-color:guishe-popup-layout-panel-color
git checkout guishe-popup-layout-panel-color
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
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#119803
No description provided.