Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2014-03-04 19:47:07 +0400
committerThomas Dinges <blender@dingto.org>2014-03-04 19:47:07 +0400
commit1754c0de3312bda162ae3709ab7b8f95a2914866 (patch)
tree34ab204e74d648dfa4f96297c091bbb5ccf503d7
parentef40e889caaf49b373fce289b70fb69e4cfb4060 (diff)
Fix T38945, empty "System Bookmarks" and "Recent" panel were drawn in the File Browser, although these were disabled in User Preferences.
-rw-r--r--source/blender/editors/space_file/file_panels.c14
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");