diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-02-11 19:07:52 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-02-11 19:13:16 +0300 |
commit | b9ffd70960c5047a003fadf2363bfed50095d79b (patch) | |
tree | cbf45b057f0104fe00948ef2c14a40c63ab98ac9 /release | |
parent | f60b4228b929ce4d77187a5bbe52f74df2c3315e (diff) |
FileBrowser Bookmarks: fix issue with invalid bookmarks.
Reported by maxon through IRC, thanks.
Invalid (inexistant) bookmarks would not be selectable, hence not removable.
First, made invalid bookmarks grayed out in lists, so that user knows when there are some.
Then, added a new 'cleanup' operator that removes all invalid bookmarks.
This solution may not be completely satisfaying, but should do the work for now.
I do not want to add back those ugly 'X' delete buttons for each entry in list,
so better solution would be to make UIList able to select several items at once...
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_filebrowser.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py index cda3dfe499d..ded307e8680 100644 --- a/release/scripts/startup/bl_ui/space_filebrowser.py +++ b/release/scripts/startup/bl_ui/space_filebrowser.py @@ -98,7 +98,12 @@ class FILEBROWSER_UL_dir(bpy.types.UIList): if self.layout_type in {'DEFAULT', 'COMPACT'}: row = layout.row(align=True) - row.prop(direntry, "name", text="", emboss=False, icon=icon) + row.enabled = direntry.is_valid + # 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'): + row.label(text=direntry.name, icon=icon) + else: + row.prop(direntry, "name", text="", emboss=False, icon=icon) elif self.layout_type in {'GRID'}: layout.alignment = 'CENTER' @@ -146,7 +151,9 @@ class FILEBROWSER_MT_bookmarks_specials(Menu): def draw(self, context): layout = self.layout + layout.operator("file.bookmark_cleanup", icon='X', text="Cleanup") + layout.separator() layout.operator("file.bookmark_move", icon='TRIA_UP_BAR', text="Move To Top").direction = 'TOP' layout.operator("file.bookmark_move", icon='TRIA_DOWN_BAR', text="Move To Bottom").direction = 'BOTTOM' |