[Bf-blender-cvs] [ca5d84b31d1] master: UI: Show ID filter settings in Link/Append File Browser as icon & checkbox

Julian Eisel noreply at git.blender.org
Fri Oct 22 23:53:20 CEST 2021


Commit: ca5d84b31d16c2e69847ffee16f8d5b092623490
Author: Julian Eisel
Date:   Fri Oct 22 12:33:28 2021 +0200
Branches: master
https://developer.blender.org/rBca5d84b31d16c2e69847ffee16f8d5b092623490

UI: Show ID filter settings in Link/Append File Browser as icon & checkbox

The checkboxes integrate better with the surrounding layout and are not that
attention grabbing. To my knowledge the only reason not to use checkboxes was
so the icons could be displayed. But this does it just like the Outliner filter
settings: Show the icon before the checkbox.

Also widen the popover a bit to fit longer labels (didn't fit before this patch
even).

===================================================================

M	release/scripts/startup/bl_ui/space_filebrowser.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py
index 641812694c8..420481eec13 100644
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@ -127,7 +127,7 @@ class FILEBROWSER_PT_display(FileBrowserPanel, Panel):
 class FILEBROWSER_PT_filter(FileBrowserPanel, Panel):
     bl_region_type = 'HEADER'
     bl_label = "Filter Settings"  # Shows as tooltip in popover
-    bl_ui_units_x = 8
+    bl_ui_units_x = 10
 
     def draw(self, context):
         layout = self.layout
@@ -195,7 +195,9 @@ class FILEBROWSER_PT_filter(FileBrowserPanel, Panel):
                 filter_id = params.filter_id
                 for identifier in dir(filter_id):
                     if identifier.startswith("category_"):
-                        sub.prop(filter_id, identifier, toggle=True)
+                        subrow = sub.row()
+                        subrow.label(icon=filter_id.bl_rna.properties[identifier].icon)
+                        subrow.prop(filter_id, identifier, toggle=False)
 
                 col.separator()
 
@@ -388,7 +390,9 @@ class FILEBROWSER_PT_advanced_filter(Panel):
             filter_id = params.filter_id
             for identifier in dir(filter_id):
                 if identifier.startswith("filter_"):
-                    col.prop(filter_id, identifier, toggle=True)
+                    row = col.row()
+                    row.label(icon=filter_id.bl_rna.properties[identifier].icon)
+                    row.prop(filter_id, identifier, toggle=False)
 
 
 def is_option_region_visible(context, space):



More information about the Bf-blender-cvs mailing list