[Bf-blender-cvs] [507dc9eb29a] experimental-build: Squashed commit of filebrowser_redesign branch

Julian Eisel noreply at git.blender.org
Fri Jul 26 01:31:36 CEST 2019


Commit: 507dc9eb29a17eacd3273d5ef232d4223af89502
Author: Julian Eisel
Date:   Fri Jul 26 01:30:19 2019 +0200
Branches: experimental-build
https://developer.blender.org/rB507dc9eb29a17eacd3273d5ef232d4223af89502

Squashed commit of filebrowser_redesign branch

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

M	release/datafiles/locale
M	release/datafiles/userdef/userdef_default_theme.c
M	release/scripts/presets/keyconfig/keymap_data/blender_default.py
M	release/scripts/startup/bl_ui/space_filebrowser.py
M	source/blender/blenkernel/BKE_screen.h
M	source/blender/blenlib/intern/BLI_filelist.c
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/blenloader/intern/versioning_userdef.c
M	source/blender/editors/include/ED_fileselect.h
M	source/blender/editors/interface/interface_panel.c
M	source/blender/editors/screen/area.c
M	source/blender/editors/space_file/file_draw.c
M	source/blender/editors/space_file/file_intern.h
M	source/blender/editors/space_file/file_ops.c
M	source/blender/editors/space_file/filelist.c
M	source/blender/editors/space_file/filelist.h
M	source/blender/editors/space_file/filesel.c
M	source/blender/editors/space_file/space_file.c
M	source/blender/makesdna/DNA_screen_types.h
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesrna/intern/rna_space.c
M	source/blender/makesrna/intern/rna_ui.c
M	source/blender/windowmanager/WM_api.h
M	source/blender/windowmanager/intern/wm_event_system.c
M	source/blender/windowmanager/intern/wm_files.c
M	source/blender/windowmanager/intern/wm_operator_props.c
M	source/blender/windowmanager/intern/wm_window.c
M	source/tools

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

diff --git a/release/datafiles/locale b/release/datafiles/locale
index 6625026f62f..2b81e2acc01 160000
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 6625026f62f492dd677f5f29c68b9d70c96fb34b
+Subproject commit 2b81e2acc011a8b79232a18dad3c00b8e654ceee
diff --git a/release/datafiles/userdef/userdef_default_theme.c b/release/datafiles/userdef/userdef_default_theme.c
index 8611a9ae881..87ab7d7c47e 100644
--- a/release/datafiles/userdef/userdef_default_theme.c
+++ b/release/datafiles/userdef/userdef_default_theme.c
@@ -385,6 +385,7 @@ const bTheme U_theme_default = {
     .button_title = RGBA(0xffffffff),
     .button_text = RGBA(0xe5e5e5ff),
     .button_text_hi = RGBA(0xffffffff),
+    .execution_buts = RGBA(0x424242ff),
     .panelcolors = {
       .header = RGBA(0x424242cc),
       .back = RGBA(0x333333b3),
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index cc4dc4d00e0..44a52e74a34 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -1825,6 +1825,7 @@ def km_file_browser_main(params):
          {"properties": [("mode", 'ADD')]}),
         ("file.rename", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, None),
         ("file.highlight", {"type": 'MOUSEMOVE', "value": 'ANY', "any": True}, None),
+        ("file.sort_column_ui_context", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None),
         ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS'},
          {"properties": [("increment", 1)]}),
         ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True},
diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py
index b939586ff81..b626d77c169 100644
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@ -34,25 +34,19 @@ class FILEBROWSER_HT_header(Header):
 
         layout.menu("FILEBROWSER_MT_view")
 
-        row = layout.row(align=True)
-        row.operator("file.previous", text="", icon='BACK')
-        row.operator("file.next", text="", icon='FORWARD')
-        row.operator("file.parent", text="", icon='FILE_PARENT')
-        row.operator("file.refresh", text="", icon='FILE_REFRESH')
-
-        layout.operator_context = 'EXEC_DEFAULT'
-        layout.operator("file.directory_new", icon='NEWFOLDER', text="")
-
-        layout.operator_context = 'INVOKE_DEFAULT'
-
         # can be None when save/reload with a file selector open
         if params:
             is_lib_browser = params.use_library_browsing
 
             layout.prop(params, "display_type", expand=True, text="")
             layout.prop(params, "sort_method", expand=True, text="")
+            layout.prop(params, "use_sort_invert")
             layout.prop(params, "show_hidden", text="", icon='FILE_HIDDEN')
 
+            row = layout.row(align=True)
+            row.prop(params, "show_details_size", text="Size")
+            row.prop(params, "show_details_datetime", text="Date")
+
         layout.separator_spacer()
 
         layout.template_running_jobs()
@@ -88,6 +82,106 @@ class FILEBROWSER_HT_header(Header):
             row.prop(params, "filter_search", text="", icon='VIEWZOOM')
 
 
+class FILEBROWSER_PT_filter(Panel):
+    bl_space_type = 'FILE_BROWSER'
+    bl_region_type = 'UI'
+    bl_label = "Filter"
+    bl_options = {'HIDDEN'}
+
+    @classmethod
+    def poll(cls, context):
+        # can be None when save/reload with a file selector open
+        return context.space_data.params is not None
+
+    def draw(self, context):
+        layout = self.layout
+
+        space = context.space_data
+        params = space.params
+        is_lib_browser = params.use_library_browsing
+
+        layout.label(text="Display Type:")
+        layout.prop(params, "display_type", expand=True, text="")
+
+        layout.label(text="Sort By:")
+        layout.prop(params, "sort_method", expand=True, text="")
+        layout.prop(params, "use_sort_invert")
+
+        layout.separator()
+
+        layout.prop(params, "show_hidden")
+
+        layout.separator()
+
+        layout.label(text="Show Details:")
+        row = layout.row(align=True)
+        row.prop(params, "show_details_size", text="Size")
+        row.prop(params, "show_details_datetime", text="Date")
+
+        layout.separator()
+
+        row = layout.row(align=True)
+        row.prop(params, "use_filter", text="", toggle=0)
+        row.label(text="Filter:")
+
+        col = layout.column()
+        col.active = params.use_filter
+
+        row = col.row()
+        row.label(icon='FILE_FOLDER')
+        row.prop(params, "use_filter_folder", text="Folders", toggle=0)
+
+        if params.filter_glob:
+            col.label(text=params.filter_glob)
+        else:
+            row = col.row()
+            row.label(icon='FILE_BLEND')
+            row.prop(params, "use_filter_blender", text=".blend Files", toggle=0)
+            row = col.row()
+            row.label(icon='FILE_BACKUP')
+            row.prop(params, "use_filter_backup", text="Backup .blend Files", toggle=0)
+            row = col.row()
+            row.label(icon='FILE_IMAGE')
+            row.prop(params, "use_filter_image", text="Image Files", toggle=0)
+            row = col.row()
+            row.label(icon='FILE_MOVIE')
+            row.prop(params, "use_filter_movie", text="Movie Files", toggle=0)
+            row = col.row()
+            row.label(icon='FILE_SCRIPT')
+            row.prop(params, "use_filter_script", text="Script Files", toggle=0)
+            row = col.row()
+            row.label(icon='FILE_FONT')
+            row.prop(params, "use_filter_font", text="Font Files", toggle=0)
+            row = col.row()
+            row.label(icon='FILE_SOUND')
+            row.prop(params, "use_filter_sound", text="Sound Files", toggle=0)
+            row = col.row()
+            row.label(icon='FILE_TEXT')
+            row.prop(params, "use_filter_text", text="Text Files", toggle=0)
+
+        col.separator()
+
+        if is_lib_browser:
+            row = col.row()
+            row.label(icon='BLANK1')  # Indentation
+            row.prop(params, "use_filter_blendid", text="Blender IDs", toggle=0)
+            if params.use_filter_blendid:
+                row = col.row()
+                row.label(icon='BLANK1')  # Indentation
+                row.prop(params, "filter_id_category", text="")
+
+                col.separator()
+
+        col.prop(params, "filter_search", text="", icon='VIEWZOOM')
+
+        layout.separator()
+
+        layout.label(text="Display Size:")
+        layout.prop(params, "display_size", text="")
+        layout.label(text="Recursion Level:")
+        layout.prop(params, "recursion_level", text="")
+
+
 class FILEBROWSER_UL_dir(UIList):
     def draw_item(self, _context, layout, _data, item, icon, _active_data, active_propname, _index):
         direntry = item
@@ -242,6 +336,81 @@ class FILEBROWSER_PT_advanced_filter(Panel):
                 col.prop(params, "filter_id")
 
 
+class FILEBROWSER_PT_directory_path(Panel):
+    bl_space_type = 'FILE_BROWSER'
+    bl_region_type = 'UI'
+    bl_label = "Directory Path"
+    bl_options = {'HIDE_HEADER'}
+
+    def is_header_visible(self, context):
+        for region in context.area.regions:
+            if region.type == 'HEADER' and region.height <= 1:
+                return False
+
+        return True
+
+    def draw(self, context):
+        layout = self.layout
+        space = context.space_data
+        params = space.params
+
+        layout.scale_x = 1.3
+        layout.scale_y = 1.3
+
+        row = layout.row()
+
+        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')
+        # TODO proper directory input text field
+
+        subrow = row.row()
+        subrow.prop(params, "directory", text="")
+
+        # TODO down triangle only created for UI_LAYOUT_HEADER
+        if self.is_header_visible(context) is False:
+            row.popover(
+                panel="FILEBROWSER_PT_filter",
+                text="",
+                icon='FILTER',
+            )
+
+        subrow = row.row(align=True)
+        subrow.operator("file.directory_new", icon='NEWFOLDER', text="")
+
+
+class FILEBROWSER_PT_file_operation(Panel):
+    bl_space_type = 'FILE_BROWSER'
+    bl_region_type = 'EXECUTE'
+    bl_label = "Execute File Operation"
+    bl_options = {'HIDE_HEADER'}
+
+    @classmethod
+    def poll(cls, context):
+        return context.space_data.active_operator
+
+    def draw(self, context):
+        layout = self.layout
+        space = context.space_data
+        params = space.params
+
+        layout.scale_x = 1.3
+        layout.scale_y = 1.3
+
+        row = layout.row()
+        sub = row.row()
+        sub.prop(params, "filename", text="")
+        sub = row.row()
+        sub.ui_units_x = 5
+        # TODO change to "Open Directory"/"Parent Directory" based on highlight.
+        subsub = sub.row()
+        subsub.active_default = True
+        subsub.operator("FILE_OT_execute", text=params.title)
+        sub.operator("FILE_OT_cancel", text="Cancel")
+
+
 class FILEBROWSER_MT_view(Menu):
     bl_label = "View"
 
@@ -265,6 +434,7 @@ class FILEBROWSER_MT_view(Menu):
 
 classes = (
     FILEBROWSER_HT_header,
+    FILEBROWSER_PT_filter,
     FILEBROWSER_UL_dir,
     FILEBROWSER_PT_bookmarks_volumes,
     FILEBROWSER_PT_bookmarks_system,
@@ -272,6 +442,8 @@ classes = (
     FILEBROWSER_PT_bookmarks_favorites,
     FILEBROWSER_PT_bookmarks_recents,
     FILEBROWSER_PT_advanced_filter,
+    FILEBROWSER_PT_directory_path,
+    FILEBROWSER_PT_file_operation,
     FILEBROWSER_MT_view,
 )
 
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index 5d3e7ad5ec2..7d992320033 10064

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list