1 # ##### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ##### END GPL LICENSE BLOCK #####
21 from bpy.types import Header
24 class FILEBROWSER_HT_header(Header):
25 bl_space_type = 'FILE_BROWSER'
27 def draw(self, context):
30 st = context.space_data
32 layout.template_header()
37 row = layout.row(align=True)
38 row.operator("file.previous", text="", icon='BACK')
39 row.operator("file.next", text="", icon='FORWARD')
40 row.operator("file.parent", text="", icon='FILE_PARENT')
41 row.operator("file.refresh", text="", icon='FILE_REFRESH')
46 row = layout.row(align=True)
47 layout.operator_context = "EXEC_DEFAULT"
48 row.operator("file.directory_new", icon='NEWFOLDER')
50 layout.operator_context = "INVOKE_DEFAULT"
53 # can be None when save/reload with a file selector open
55 layout.prop(params, "display_type", expand=True, text="")
56 layout.prop(params, "sort_method", expand=True, text="")
58 layout.prop(params, "show_hidden")
59 layout.prop(params, "use_filter", text="", icon='FILTER')
61 row = layout.row(align=True)
62 row.active = params.use_filter
64 row.prop(params, "use_filter_folder", text="")
66 if params.filter_glob:
67 #if st.active_operator and hasattr(st.active_operator, "filter_glob"):
68 # row.prop(params, "filter_glob", text="")
69 row.label(params.filter_glob)
71 row.prop(params, "use_filter_blender", text="")
72 row.prop(params, "use_filter_backup", text="")
73 row.prop(params, "use_filter_image", text="")
74 row.prop(params, "use_filter_movie", text="")
75 row.prop(params, "use_filter_script", text="")
76 row.prop(params, "use_filter_font", text="")
77 row.prop(params, "use_filter_sound", text="")
78 row.prop(params, "use_filter_text", text="")
80 if __name__ == "__main__": # only for live edit.
81 bpy.utils.register_module(__name__)