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:
authorAndrea Weikert <elubie@gmx.net>2009-06-30 02:16:48 +0400
committerAndrea Weikert <elubie@gmx.net>2009-06-30 02:16:48 +0400
commit17d5bfd9709583cb58c030ecea3f7d3fb44a81ad (patch)
tree85b689a0f000f0bdabbbe856154745084488a91a /source/blender/editors/space_file/file_panels.c
parent84cd5a6cfbd607e73f8b2f522983520b18b1b63b (diff)
2.5 file browser
* bookmark operators: add and delete bookmark * first start at menus in file browser: Directory and Bookmarks * Adding a bookmark via menu or via CTRL+B * Remove a bookmark with the X button next to it.
Diffstat (limited to 'source/blender/editors/space_file/file_panels.c')
-rw-r--r--source/blender/editors/space_file/file_panels.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c
index 815345f34c8..b370624d312 100644
--- a/source/blender/editors/space_file/file_panels.c
+++ b/source/blender/editors/space_file/file_panels.c
@@ -26,7 +26,7 @@ static void do_file_panel_events(bContext *C, void *arg, int event)
}
-static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory category, int icon)
+static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory category, int icon, int allow_delete)
{
uiBlock *block;
uiStyle *style= U.uistyles.first;
@@ -41,26 +41,29 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat
uiBlockSetEmboss(block, UI_EMBOSSP);
uiBlockBeginAlign(block);
for (i=0; i< nentries;++i) {
+ uiLayout* layout = uiLayoutRow(pa->layout, UI_LAYOUT_ALIGN_LEFT);
char *fname = fsmenu_get_entry(fsmenu, category, i);
- uiItemStringO(pa->layout, fname, icon, "FILE_OT_select_bookmark", "dir", fname);
+ uiItemStringO(layout, fname, icon, "FILE_OT_select_bookmark", "dir", fname);
+ if (allow_delete)
+ uiItemIntO(layout, "", ICON_X, "FILE_OT_delete_bookmark", "index", i);
}
uiBlockEndAlign(block);
}
static void file_panel_system(const bContext *C, Panel *pa)
{
- file_panel_category(C, pa, FS_CATEGORY_SYSTEM, ICON_DISK_DRIVE);
+ file_panel_category(C, pa, FS_CATEGORY_SYSTEM, ICON_DISK_DRIVE, 0);
}
static void file_panel_bookmarks(const bContext *C, Panel *pa)
{
- file_panel_category(C, pa, FS_CATEGORY_BOOKMARKS, ICON_BOOKMARKS);
+ file_panel_category(C, pa, FS_CATEGORY_BOOKMARKS, ICON_BOOKMARKS, 1);
}
static void file_panel_recent(const bContext *C, Panel *pa)
{
- file_panel_category(C, pa, FS_CATEGORY_RECENT, ICON_FILE_FOLDER);
+ file_panel_category(C, pa, FS_CATEGORY_RECENT, ICON_FILE_FOLDER, 0);
}