diff options
author | Thomas Dinges <blender@dingto.org> | 2014-03-04 19:47:07 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2014-03-04 19:47:07 +0400 |
commit | 1754c0de3312bda162ae3709ab7b8f95a2914866 (patch) | |
tree | 34ab204e74d648dfa4f96297c091bbb5ccf503d7 /source | |
parent | ef40e889caaf49b373fce289b70fb69e4cfb4060 (diff) |
Fix T38945, empty "System Bookmarks" and "Recent" panel were drawn in the File Browser, although these were disabled in User Preferences.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_file/file_panels.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index 77cea89f2f7..4b81b726dcf 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -135,6 +135,12 @@ static void file_panel_system(const bContext *C, Panel *pa) file_panel_category(C, pa, FS_CATEGORY_SYSTEM, &sfile->systemnr, ICON_DISK_DRIVE, 0); } +static int file_panel_system_bookmarks_poll(const bContext *C, PanelType *UNUSED(pt)) +{ + SpaceFile *sfile = CTX_wm_space_file(C); + return (sfile && !(U.uiflag & USER_HIDE_SYSTEM_BOOKMARKS)); +} + static void file_panel_system_bookmarks(const bContext *C, Panel *pa) { SpaceFile *sfile = CTX_wm_space_file(C); @@ -159,6 +165,12 @@ static void file_panel_bookmarks(const bContext *C, Panel *pa) } } +static int file_panel_recent_poll(const bContext *C, PanelType *UNUSED(pt)) +{ + SpaceFile *sfile = CTX_wm_space_file(C); + return (sfile && !(U.uiflag & USER_HIDE_RECENT)); +} + static void file_panel_recent(const bContext *C, Panel *pa) { SpaceFile *sfile = CTX_wm_space_file(C); @@ -228,6 +240,7 @@ void file_panels_register(ARegionType *art) strcpy(pt->label, N_("System Bookmarks")); strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = file_panel_system_bookmarks; + pt->poll = file_panel_system_bookmarks_poll; BLI_addtail(&art->paneltypes, pt); pt = MEM_callocN(sizeof(PanelType), "spacetype file bookmarks"); @@ -242,6 +255,7 @@ void file_panels_register(ARegionType *art) strcpy(pt->label, N_("Recent")); strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = file_panel_recent; + pt->poll = file_panel_recent_poll; BLI_addtail(&art->paneltypes, pt); pt = MEM_callocN(sizeof(PanelType), "spacetype file operator properties"); |