Python: UI issues with invoke_props_dialog() #35154

Closed
opened 2013-04-29 21:11:31 +02:00 by CodeManX · 8 comments
Member

%%%1.) invoke_props_dialog() is kinda special, since that dialog stays opened even if user mouse leaves the its bounds. So it should really execute the operator if OK is clicked, and vanish if user clicks outside. If you add a dropdown list, e.g. prop_search(), a click to pick an items from list may be considered as a click outside of the dialog bounds. As long as such a list is opened, clicks should be ignored by the dialog and only be handled by the list (nom-nom-principle). See attached script, run and try to select "Material 6".

2.) The relatively new "x" icon to the right of the prop_search field doesn't work inside of the invoke_props_dialog, possibly not in the other popups either. It either should work, or icon not be shown - i'd prefer the former.

3.) Without custom draw() func, the StringProperty's label is shown above the input field (2 rows). With a custom draw(), the label draws in front of the input field (one row). Is there a nicer way to put the label above other than label(...) + prop(..., text="")? See attached picture.%%%

%%%1.) invoke_props_dialog() is kinda special, since that dialog stays opened even if user mouse leaves the its bounds. So it should really execute the operator if OK is clicked, and vanish if user clicks outside. If you add a dropdown list, e.g. prop_search(), a click to pick an items from list may be considered as a click outside of the dialog bounds. As long as such a list is opened, clicks should be ignored by the dialog and only be handled by the list (nom-nom-principle). See attached script, run and try to select "Material 6". 2.) The relatively new "x" icon to the right of the prop_search field doesn't work inside of the invoke_props_dialog, possibly not in the other popups either. It either should work, or icon not be shown - i'd prefer the former. 3.) Without custom draw() func, the StringProperty's label is shown above the input field (2 rows). With a custom draw(), the label draws in front of the input field (one row). Is there a nicer way to put the label above other than label(...) + prop(..., text="")? See attached picture.%%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

%%%4.) If you add operator buttons to the dialog, they will work exactly once. If you click again, nothing happens. If you add the same op 3x, then each of the buttons will work 1x. I tried to workaround this using props with update callbacks and other stuff that came to mind, but it didn't work either or even crashed Blender.%%%

%%%4.) If you add operator buttons to the dialog, they will work exactly once. If you click again, nothing happens. If you add the same op 3x, then each of the buttons will work 1x. I tried to workaround this using props with update callbacks and other stuff that came to mind, but it didn't work either or even crashed Blender.%%%

%%%fixed bugs 1, 2.

3 isn't a bug, this is simply rows vs columns, without a custom draw function its drawing columns.

4 - is know problem, but not trivial to change.
better postpone this until after 2.67 release.%%%

%%%fixed bugs 1, 2. 3 isn't a bug, this is simply rows vs columns, without a custom draw function its drawing columns. 4 - is know problem, but not trivial to change. better postpone this until after 2.67 release.%%%
Author
Member

%%%Well there is no difference between layout.column() and layout.row() in the result with a custom draw method

      layout = self.layout
      col = layout.column()
      col.prop_search(self, "prop", self, "mats", icon='MATERIAL')

it will still put the label left and the field next to it to the right, not a column.%%%

%%%Well there is no difference between layout.column() and layout.row() in the result with a custom draw method ``` layout = self.layout col = layout.column() col.prop_search(self, "prop", self, "mats", icon='MATERIAL') ``` it will still put the label left and the field next to it to the right, not a column.%%%

%%%Ah I see now,
The info to do a prop_search button isnt stored in the properties, (the relationship between "prop" and "mats"), so the automatic UI wont display these.

Added todo:
http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/UserInterface#UI_Widgets

And a todo for operator buttons only executing once (in this case it may be best to have a way to redraw the region)
http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/UserInterface#Regions
%%%

%%%Ah I see now, The info to do a prop_search button isnt stored in the properties, (the relationship between "prop" and "mats"), so the automatic UI wont display these. Added todo: http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/UserInterface#UI_Widgets And a todo for operator buttons only executing once (in this case it may be best to have a way to redraw the region) http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/UserInterface#Regions %%%

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Member

Going through the UI ToDo tasks to check status. It seems to me 4) is resolved? I.e. you can have buttons there and press them multiple times. Not sure though if I understand correctly.

Going through the UI ToDo tasks to check status. It seems to me 4) is resolved? I.e. you can have buttons there and press them multiple times. Not sure though if I understand correctly.
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#35154
No description provided.