Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-07-20 21:21:56 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-07-20 21:21:56 +0300
commitd28575213d7a8028b2817584b92a71b4205b8aca (patch)
tree11635a6022173a09a19f6edd37b93f4a575876e7 /release/scripts/startup
parentfd0fffaedeb45e249f4ca6b29745e14ec20b36fa (diff)
parented870f87b94224c195cbe2df14445e4808b7b5f3 (diff)
Merge branch 'master' into greasepencil-edit-curve
Diffstat (limited to 'release/scripts/startup')
-rw-r--r--release/scripts/startup/bl_ui/space_filebrowser.py4
-rw-r--r--release/scripts/startup/bl_ui/space_toolsystem_common.py34
-rw-r--r--release/scripts/startup/bl_ui/space_toolsystem_toolbar.py10
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py2
4 files changed, 32 insertions, 18 deletions
diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py
index f37edd05fd2..257ef420ef9 100644
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@ -97,9 +97,7 @@ class FILEBROWSER_PT_filter(Panel):
params = space.params
is_lib_browser = params.use_library_browsing
- row = layout.row(align=True)
- row.prop(params, "use_filter", text="", toggle=False)
- row.label(text="Filter")
+ layout.prop(params, "use_filter", text="Filter", toggle=False)
col = layout.column()
col.active = params.use_filter
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py
index 080e66b59e7..50316f50474 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_common.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py
@@ -271,19 +271,24 @@ class ToolSelectPanelHelper:
yield item, i
i += 1
- # Special internal function, gives use items that contain keymaps.
@staticmethod
- def _tools_flatten_with_keymap(tools):
+ def _tools_flatten_with_dynamic(tools, *, context):
+ """
+ Expands dynamic items, indices aren't aligned with other flatten functions.
+ The context may be None, use as signal to return all items.
+ """
for item_parent in tools:
if item_parent is None:
- continue
+ yield None
for item in item_parent if (type(item_parent) is tuple) else (item_parent,):
- # skip None or generator function
- if item is None or _item_is_fn(item):
- continue
- if item.keymap is not None:
+ if item is None:
+ yield None
+ elif _item_is_fn(item):
+ yield from ToolSelectPanelHelper._tools_flatten_with_dynamic(item(context), context=context)
+ else:
yield item
+
@classmethod
def _tool_get_active(cls, context, space_type, mode, with_icon=False):
"""
@@ -484,8 +489,12 @@ class ToolSelectPanelHelper:
else:
context_descr = context_mode.replace("_", " ").title()
- for item in cls._tools_flatten_with_keymap(tools):
+ for item in cls._tools_flatten_with_dynamic(tools, context=None):
+ if item is None:
+ continue
keymap_data = item.keymap
+ if keymap_data is None:
+ continue
if callable(keymap_data[0]):
cls._km_action_simple(kc_default, kc_default, context_descr, item.label, keymap_data)
@@ -498,8 +507,13 @@ class ToolSelectPanelHelper:
for context_mode_test, tools in cls.tools_all():
if context_mode_test == context_mode:
- for item in cls._tools_flatten_with_keymap(tools):
- km_name = item.keymap[0]
+ for item in cls._tools_flatten(tools):
+ if item is None:
+ continue
+ keymap_data = item.keymap
+ if keymap_data is None:
+ continue
+ km_name = keymap_data[0]
# print((km.name, cls.bl_space_type, 'WINDOW', []))
if km_name in visited:
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index b7852eb92e0..ce48b92c419 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -2496,15 +2496,17 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
_defs_sculpt.cloth_filter,
lambda context: (
(_defs_sculpt.color_filter,)
- if bpy.context.preferences.view.show_developer_ui and \
- bpy.context.preferences.experimental.use_sculpt_vertex_colors
+ if context is None or (
+ context.preferences.view.show_developer_ui and
+ context.preferences.experimental.use_sculpt_vertex_colors)
else ()
),
None,
lambda context: (
(_defs_sculpt.mask_by_color,)
- if bpy.context.preferences.view.show_developer_ui and \
- bpy.context.preferences.experimental.use_sculpt_vertex_colors
+ if context is None or (
+ context.preferences.view.show_developer_ui and
+ context.preferences.experimental.use_sculpt_vertex_colors)
else ()
),
None,
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 077b53559aa..007b8c933ce 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -6169,7 +6169,7 @@ class VIEW3D_PT_overlay_motion_tracking(Panel):
def draw_header(self, context):
view = context.space_data
- self.layout.prop(view, "show_reconstruction", text="")
+ self.layout.prop(view, "show_reconstruction", text=self.bl_label)
def draw(self, context):
layout = self.layout