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.
This commit is contained in:
Julian Eisel 2019-09-29 20:32:07 +02:00
parent 57519f237a
commit 98c0d16da5
Notes: blender-bot 2023-02-14 05:22:18 +01:00
Referenced by issue #69652, File Browser GUI: Planned Changes for 2.81
1 changed files with 19 additions and 15 deletions

View File

@ -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',