diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2019-09-29 21:32:07 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2019-09-29 21:37:51 +0300 |
commit | 98c0d16da53ab45d1927b90429b45a558398cbf2 (patch) | |
tree | ecbc0aff0be124b9d9d1872dd1fdb32088da4ce4 | |
parent | 57519f237a914aa2645c44bf86917c05f6e45e30 (diff) |
UI: Use responive layout for upper bar in file browser
The upper bar (containing file path, navigation and display buttons) may
now be split into two rows as horizontal space is reduced.
The first row contains the navigation related buttons, the lower one the
filter and display related ones.
Mainly solves the issue where the file path and search buttons became
barely usable in tight layouts, but generally makes things better for
such cases.
-rw-r--r-- | release/scripts/startup/bl_ui/space_filebrowser.py | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py index c0d954261f6..a322b96f9dd 100644 --- a/release/scripts/startup/bl_ui/space_filebrowser.py +++ b/release/scripts/startup/bl_ui/space_filebrowser.py @@ -361,33 +361,37 @@ class FILEBROWSER_PT_directory_path(Panel): layout.scale_y = 1.3 row = layout.row() + flow = row.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=False) - subrow = row.row(align=True) - subrow.operator("file.previous", text="", icon='BACK') - subrow.operator("file.next", text="", icon='FORWARD') - subrow.operator("file.parent", text="", icon='FILE_PARENT') - subrow.operator("file.refresh", text="", icon='FILE_REFRESH') + subrow = flow.row() - subrow = row.row() - subrow.operator_context = 'EXEC_DEFAULT' - subrow.operator("file.directory_new", icon='NEWFOLDER', text="") + subsubrow = subrow.row(align=True) + subsubrow.operator("file.previous", text="", icon='BACK') + subsubrow.operator("file.next", text="", icon='FORWARD') + subsubrow.operator("file.parent", text="", icon='FILE_PARENT') + subsubrow.operator("file.refresh", text="", icon='FILE_REFRESH') + + subsubrow = subrow.row() + subsubrow.operator_context = 'EXEC_DEFAULT' + subsubrow.operator("file.directory_new", icon='NEWFOLDER', text="") - subrow = row.row() subrow.template_file_select_path(params) - subrow = row.row() - subrow.scale_x = 0.5 - subrow.prop(params, "filter_search", text="", icon='VIEWZOOM') + subrow = flow.row() + + subsubrow = subrow.row() + 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. - row.prop_with_popover( + subrow.prop_with_popover( params, "display_type", panel="FILEBROWSER_PT_display", text="", icon_only=True, ) - row.prop_with_popover( + subrow.prop_with_popover( params, "display_type", panel="FILEBROWSER_PT_filter", @@ -397,7 +401,7 @@ class FILEBROWSER_PT_directory_path(Panel): ) if space.active_operator: - row.operator( + subrow.operator( "screen.region_toggle", text="", icon='PREFERENCES', |