Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_filebrowser.py
| Show All 38 Lines | def draw(self, context): | ||||
| layout.separator_spacer() | layout.separator_spacer() | ||||
| layout.template_running_jobs() | layout.template_running_jobs() | ||||
| class FILEBROWSER_PT_display(Panel): | class FILEBROWSER_PT_display(Panel): | ||||
| bl_space_type = 'FILE_BROWSER' | bl_space_type = 'FILE_BROWSER' | ||||
| bl_region_type = 'HEADER' | bl_region_type = 'HEADER' | ||||
| bl_label = "Display" | bl_label = "Display Settings" # Shows as tooltip in popover | ||||
| bl_ui_units_x = 10 | |||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| # can be None when save/reload with a file selector open | # can be None when save/reload with a file selector open | ||||
| return context.space_data.params is not None | return context.space_data.params is not None | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| space = context.space_data | space = context.space_data | ||||
| params = space.params | params = space.params | ||||
| layout.label(text="Display as") | |||||
| layout.column().prop(params, "display_type", expand=True) | |||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False # No animation. | layout.use_property_decorate = False # No animation. | ||||
| if params.display_type == 'THUMBNAIL': | if params.display_type == 'THUMBNAIL': | ||||
| layout.prop(params, "display_size", text="Size") | layout.prop(params, "display_size", text="Size") | ||||
| else: | else: | ||||
| col = layout.column(heading="Columns", align=True) | col = layout.column(heading="Columns", align=True) | ||||
| col.prop(params, "show_details_size", text="Size") | col.prop(params, "show_details_size", text="Size") | ||||
| col.prop(params, "show_details_datetime", text="Date") | col.prop(params, "show_details_datetime", text="Date") | ||||
| layout.prop(params, "recursion_level", text="Recursions") | layout.prop(params, "recursion_level", text="Recursions") | ||||
| layout.use_property_split = False | layout.column().prop(params, "sort_method", text="Sort By", expand=True) | ||||
| layout.separator() | |||||
| layout.label(text="Sort by") | |||||
| layout.column().prop(params, "sort_method", expand=True) | |||||
| layout.prop(params, "use_sort_invert") | layout.prop(params, "use_sort_invert") | ||||
| class FILEBROWSER_PT_filter(Panel): | class FILEBROWSER_PT_filter(Panel): | ||||
| bl_space_type = 'FILE_BROWSER' | bl_space_type = 'FILE_BROWSER' | ||||
| bl_region_type = 'HEADER' | bl_region_type = 'HEADER' | ||||
| bl_label = "Filter" | bl_label = "Filter Settings" # Shows as tooltip in popover | ||||
| bl_ui_units_x = 8 | |||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| # can be None when save/reload with a file selector open | # can be None when save/reload with a file selector open | ||||
| return context.space_data.params is not None | return context.space_data.params is not None | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| space = context.space_data | space = context.space_data | ||||
| params = space.params | params = space.params | ||||
| is_lib_browser = params.use_library_browsing | is_lib_browser = params.use_library_browsing | ||||
| layout.prop(params, "use_filter", text="Filter", toggle=False) | |||||
| col = layout.column() | col = layout.column() | ||||
| col.active = params.use_filter | col.active = params.use_filter | ||||
| row = col.row() | row = col.row() | ||||
| row.label(icon='FILE_FOLDER') | row.label(icon='FILE_FOLDER') | ||||
| row.prop(params, "use_filter_folder", text="Folders", toggle=False) | row.prop(params, "use_filter_folder", text="Folders", toggle=False) | ||||
| if params.filter_glob: | if params.filter_glob: | ||||
| ▲ Show 20 Lines • Show All 268 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| subrow.template_file_select_path(params) | subrow.template_file_select_path(params) | ||||
| subrow = flow.row() | subrow = flow.row() | ||||
| subsubrow = subrow.row() | subsubrow = subrow.row() | ||||
| subsubrow.scale_x = 0.6 | subsubrow.scale_x = 0.6 | ||||
| subsubrow.prop(params, "filter_search", text="", icon='VIEWZOOM') | subsubrow.prop(params, "filter_search", text="", icon='VIEWZOOM') | ||||
| # Uses prop_with_popover() as popover() only adds the triangle icon in headers. | subsubrow = subrow.row(align=True) | ||||
| subrow.prop_with_popover( | subsubrow.prop(params, "display_type", expand=True, icon_only=True) | ||||
| params, | subsubrow.popover("FILEBROWSER_PT_display", text="") | ||||
| "display_type", | |||||
| panel="FILEBROWSER_PT_display", | subsubrow = subrow.row(align=True) | ||||
| text="", | subsubrow.prop(params, "use_filter", toggle=True, icon='FILTER', icon_only=True) | ||||
| icon_only=True, | subsubrow.popover("FILEBROWSER_PT_filter", text="") | ||||
| ) | |||||
| subrow.prop_with_popover( | |||||
| params, | |||||
| "display_type", | |||||
| panel="FILEBROWSER_PT_filter", | |||||
| text="", | |||||
| icon='FILTER', | |||||
| icon_only=True, | |||||
| ) | |||||
| if space.active_operator: | if space.active_operator: | ||||
| subrow.operator( | subrow.operator( | ||||
| "screen.region_toggle", | "screen.region_toggle", | ||||
| text="", | text="", | ||||
| icon='PREFERENCES', | icon='PREFERENCES', | ||||
| depress=self.is_option_region_visible(context, space) | depress=self.is_option_region_visible(context, space) | ||||
| ).region_type = 'TOOL_PROPS' | ).region_type = 'TOOL_PROPS' | ||||
| ▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines | |||||