Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_filebrowser.py
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| # Note that after "Flip Regions" it's right-aligned. | # Note that after "Flip Regions" it's right-aligned. | ||||
| return region.alignment in {'LEFT', 'RIGHT'} | return region.alignment in {'LEFT', 'RIGHT'} | ||||
| class FILEBROWSER_UL_dir(UIList): | class FILEBROWSER_UL_dir(UIList): | ||||
| def draw_item(self, _context, layout, _data, item, icon, _active_data, active_propname, _index): | def draw_item(self, _context, layout, _data, item, icon, _active_data, active_propname, _index): | ||||
| direntry = item | direntry = item | ||||
| # space = context.space_data | # space = context.space_data | ||||
| icon = 'NONE' | |||||
| if active_propname == "system_folders_active": | |||||
| icon = 'DISK_DRIVE' | |||||
| if active_propname == "system_bookmarks_active": | |||||
| icon = 'BOOKMARKS' | |||||
| if active_propname == "bookmarks_active": | |||||
| icon = 'BOOKMARKS' | |||||
| if active_propname == "recent_folders_active": | |||||
| icon = 'FILE_FOLDER' | |||||
| if self.layout_type in {'DEFAULT', 'COMPACT'}: | if self.layout_type in {'DEFAULT', 'COMPACT'}: | ||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| row.enabled = direntry.is_valid | row.enabled = direntry.is_valid | ||||
| # Non-editable entries would show grayed-out, which is bad in this specific case, so switch to mere label. | # Non-editable entries would show grayed-out, which is bad in this specific case, so switch to mere label. | ||||
| if direntry.is_property_readonly("name"): | if direntry.is_property_readonly("name"): | ||||
| row.label(text=direntry.name, icon=icon) | row.label(text=direntry.name, icon_value=icon) | ||||
| else: | else: | ||||
| row.prop(direntry, "name", text="", emboss=False, icon=icon) | row.prop(direntry, "name", text="", emboss=False, icon_value=icon) | ||||
| elif self.layout_type == 'GRID': | elif self.layout_type == 'GRID': | ||||
| layout.alignment = 'CENTER' | layout.alignment = 'CENTER' | ||||
| layout.prop(direntry, "path", text="") | layout.prop(direntry, "path", text="") | ||||
| class FILEBROWSER_PT_bookmarks_volumes(Panel): | class FILEBROWSER_PT_bookmarks_volumes(Panel): | ||||
| bl_space_type = 'FILE_BROWSER' | bl_space_type = 'FILE_BROWSER' | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||