[Bf-blender-cvs] [98c0d16da53] master: UI: Use responive layout for upper bar in file browser

Julian Eisel noreply at git.blender.org
Sun Sep 29 20:38:13 CEST 2019


Commit: 98c0d16da53ab45d1927b90429b45a558398cbf2
Author: Julian Eisel
Date:   Sun Sep 29 20:32:07 2019 +0200
Branches: master
https://developer.blender.org/rB98c0d16da53ab45d1927b90429b45a558398cbf2

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.

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

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



More information about the Bf-blender-cvs mailing list