diff options
author | Hans Goudey <h.goudey@me.com> | 2020-09-03 18:02:09 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-09-03 18:02:09 +0300 |
commit | c8e5924cbb0b87fc429d0052ed6bdc5e30adcfd7 (patch) | |
tree | bfdb8908705925a80a46623ee7b54726a1383c1e /release/scripts/startup/bl_ui | |
parent | eb82b3947e3d5883971645604011a682901b4ede (diff) |
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
Diffstat (limited to 'release/scripts/startup/bl_ui')
-rw-r--r-- | release/scripts/startup/bl_ui/space_filebrowser.py | 40 |
1 files changed, 12 insertions, 28 deletions
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( |