[Bf-blender-cvs] [c8e5924cbb0] master: UI: Expose important settings from file browser popovers

Hans Goudey noreply at git.blender.org
Thu Sep 3 17:02:58 CEST 2020


Commit: c8e5924cbb0b87fc429d0052ed6bdc5e30adcfd7
Author: Hans Goudey
Date:   Thu Sep 3 10:02:09 2020 -0500
Branches: master
https://developer.blender.org/rBc8e5924cbb0b87fc429d0052ed6bdc5e30adcfd7

UI: Expose important settings from file browser popovers

We have established a convention of exposing the most important
settings from popovers, then aligning a popover to control more
detailed settings.

The file browser has powerful display / filtering settings, but
they're hidden in popovers at the moment, so it's sometimes a pain
to use them. The "display as" options are now exposed to the left of
the display settings popover, and the "filter" toggle is exposed to
the left of the filter settings popover. This convention is familiar
and intuitive for users and makes interaction faster.

Note that the "show hidden" item in the filter popover still has an
effect if filtering is disabled.

This commit also:
 - Removes the icons in the "Sort By" enum
 - Uses property split for the "Sort By" enum
 - Very slightly increases the default width of the file browser
   window to make room for the new buttons.

Differential Revision: https://developer.blender.org/D8719

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

M	release/datafiles/userdef/userdef_default.c
M	release/scripts/startup/bl_ui/space_filebrowser.py
M	source/blender/makesrna/intern/rna_space.c

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

diff --git a/release/datafiles/userdef/userdef_default.c b/release/datafiles/userdef/userdef_default.c
index df1be29f642..7a521d41b88 100644
--- a/release/datafiles/userdef/userdef_default.c
+++ b/release/datafiles/userdef/userdef_default.c
@@ -218,7 +218,7 @@ const UserDef U_default = {
             .flag = FILE_HIDE_DOT,
             .filter_id = FILTER_ID_ALL,
 
-            .temp_win_sizex = 1020,
+            .temp_win_sizex = 1060,
             .temp_win_sizey = 600,
         },
 
diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py
index 257ef420ef9..2c52d9cd337 100644
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@ -44,7 +44,8 @@ class FILEBROWSER_HT_header(Header):
 class FILEBROWSER_PT_display(Panel):
     bl_space_type = 'FILE_BROWSER'
     bl_region_type = 'HEADER'
-    bl_label = "Display"
+    bl_label = "Display Settings" # Shows as tooltip in popover
+    bl_ui_units_x = 10
 
     @classmethod
     def poll(cls, context):
@@ -57,9 +58,6 @@ class FILEBROWSER_PT_display(Panel):
         space = context.space_data
         params = space.params
 
-        layout.label(text="Display as")
-        layout.column().prop(params, "display_type", expand=True)
-
         layout.use_property_split = True
         layout.use_property_decorate = False  # No animation.
 
@@ -72,18 +70,15 @@ class FILEBROWSER_PT_display(Panel):
 
         layout.prop(params, "recursion_level", text="Recursions")
 
-        layout.use_property_split = False
-        layout.separator()
-
-        layout.label(text="Sort by")
-        layout.column().prop(params, "sort_method", expand=True)
+        layout.column().prop(params, "sort_method", text="Sort By", expand=True)
         layout.prop(params, "use_sort_invert")
 
 
 class FILEBROWSER_PT_filter(Panel):
     bl_space_type = 'FILE_BROWSER'
     bl_region_type = 'HEADER'
-    bl_label = "Filter"
+    bl_label = "Filter Settings" # Shows as tooltip in popover
+    bl_ui_units_x = 8
 
     @classmethod
     def poll(cls, context):
@@ -97,8 +92,6 @@ class FILEBROWSER_PT_filter(Panel):
         params = space.params
         is_lib_browser = params.use_library_browsing
 
-        layout.prop(params, "use_filter", text="Filter", toggle=False)
-
         col = layout.column()
         col.active = params.use_filter
 
@@ -383,22 +376,13 @@ class FILEBROWSER_PT_directory_path(Panel):
         subsubrow.scale_x = 0.6
         subsubrow.prop(params, "filter_search", text="", icon='VIEWZOOM')
 
-        # Uses prop_with_popover() as popover() only adds the triangle icon in headers.
-        subrow.prop_with_popover(
-            params,
-            "display_type",
-            panel="FILEBROWSER_PT_display",
-            text="",
-            icon_only=True,
-        )
-        subrow.prop_with_popover(
-            params,
-            "display_type",
-            panel="FILEBROWSER_PT_filter",
-            text="",
-            icon='FILTER',
-            icon_only=True,
-        )
+        subsubrow = subrow.row(align=True)
+        subsubrow.prop(params, "display_type", expand=True, icon_only=True)
+        subsubrow.popover("FILEBROWSER_PT_display", text="")
+
+        subsubrow = subrow.row(align=True)
+        subsubrow.prop(params, "use_filter", toggle=True, icon='FILTER', icon_only=True)
+        subsubrow.popover("FILEBROWSER_PT_filter", text="")
 
         if space.active_operator:
             subrow.operator(
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index b30a8e4bbdc..34a84ce9265 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -464,22 +464,18 @@ static const EnumPropertyItem fileselectparams_recursion_level_items[] = {
 };
 
 const EnumPropertyItem rna_enum_file_sort_items[] = {
-    {FILE_SORT_ALPHA,
-     "FILE_SORT_ALPHA",
-     ICON_SORTALPHA,
-     "Name",
-     "Sort the file list alphabetically"},
+    {FILE_SORT_ALPHA, "FILE_SORT_ALPHA", ICON_NONE, "Name", "Sort the file list alphabetically"},
     {FILE_SORT_EXTENSION,
      "FILE_SORT_EXTENSION",
-     ICON_SORTBYEXT,
+     ICON_NONE,
      "Extension",
      "Sort the file list by extension/type"},
     {FILE_SORT_TIME,
      "FILE_SORT_TIME",
-     ICON_SORTTIME,
+     ICON_NONE,
      "Modified Date",
      "Sort files by modification time"},
-    {FILE_SORT_SIZE, "FILE_SORT_SIZE", ICON_SORTSIZE, "Size", "Sort files by size"},
+    {FILE_SORT_SIZE, "FILE_SORT_SIZE", ICON_NONE, "Size", "Sort files by size"},
     {0, NULL, 0, NULL, NULL},
 };



More information about the Bf-blender-cvs mailing list