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>2008-02-18 00:34:56 +0300
committerAndrea Weikert <elubie@gmx.net>2008-02-18 00:34:56 +0300
commitb7cf0ecbf6550d2c2293ea74c7c4950572c3a68f (patch)
tree14ff1e02bef5ed29d59c10db32eb795cde236d13 /source/blender/src/drawimasel.c
parentfcd78f08173564f2042dc8e574fc3dc7cee883ed (diff)
== ImageBrowser ==
added icon for 'Toggle Bookmark Area' disabled the bookmarks for databrowse allow to add path inside .blend file (could be nice to use as material library for example)
Diffstat (limited to 'source/blender/src/drawimasel.c')
-rw-r--r--source/blender/src/drawimasel.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/src/drawimasel.c b/source/blender/src/drawimasel.c
index 88b6beb54c5..6fa625592be 100644
--- a/source/blender/src/drawimasel.c
+++ b/source/blender/src/drawimasel.c
@@ -118,7 +118,7 @@ void calc_imasel_rcts(SpaceImaSel *simasel, int winx, int winy)
simasel->v2d.vert.ymin += TILE_BORDER_Y + 2;
// simasel->v2d.mask.xmax= simasel->v2d.vert.xmin;
- if (simasel->flag & FILE_BOOKMARKS) {
+ if ((simasel->flag & FILE_BOOKMARKS) && (simasel->type != FILE_MAIN)) {
int bmwidth = (simasel->v2d.vert.xmin - simasel->v2d.mask.xmin)/4.0f;
if (bmwidth > BOOKMARKWIDTH_MAX) bmwidth = BOOKMARKWIDTH_MAX;
@@ -238,7 +238,7 @@ static void draw_imasel_bookmarks(ScrArea *sa, SpaceImaSel *simasel)
char bookmark[FILE_MAX];
float sw;
- if (simasel->flag & FILE_BOOKMARKS) {
+ if ((simasel->flag & FILE_BOOKMARKS) && (simasel->type != FILE_MAIN)) {
int nentries = fsmenu_get_nentries();
int i;
short sx, sy;
@@ -607,6 +607,8 @@ static void draw_imasel_buttons(ScrArea *sa, SpaceImaSel* simasel)
float slen;
float parentbut_width = 20;
float bookmarkbut_width = 0.0f;
+ float file_start_width = 0.0f;
+
int filebuty1, filebuty2;
float xmin = simasel->v2d.mask.xmin + 10;
@@ -635,11 +637,12 @@ static void draw_imasel_buttons(ScrArea *sa, SpaceImaSel* simasel)
menu= fsmenu_build_menu();
- if (menu[0]) {
+ if (menu[0]&& (simasel->type != FILE_MAIN)) {
bookmarkbut_width = parentbut_width;
+ file_start_width = parentbut_width;
}
- uiDefBut(block, TEX, B_FS_FILENAME,"", xmin+parentbut_width+bookmarkbut_width+2, filebuty1, xmax-xmin-loadbutton-parentbut_width-bookmarkbut_width, 21, simasel->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, "");
+ uiDefBut(block, TEX, B_FS_FILENAME,"", xmin+file_start_width+bookmarkbut_width+2, filebuty1, xmax-xmin-loadbutton-file_start_width-bookmarkbut_width, 21, simasel->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, "");
uiDefBut(block, TEX, B_FS_DIRNAME,"", xmin+parentbut_width, filebuty2, xmax-xmin-loadbutton-parentbut_width, 21, simasel->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, "");
if(loadbutton) {
@@ -648,7 +651,9 @@ static void draw_imasel_buttons(ScrArea *sa, SpaceImaSel* simasel)
uiDefBut(block, BUT,B_FS_CANCEL, "Cancel", xmax-loadbutton, filebuty1, loadbutton, 21, simasel->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, "");
}
- if(menu[0]) { // happens when no .Bfs is there, and first time browse
+ /* menu[0] = NULL happens when no .Bfs is there, and first time browse
+ disallow external directory browsing for databrowse */
+ if(menu[0] && (simasel->type != FILE_MAIN)) {
uiDefButS(block, MENU,B_FS_DIR_MENU, menu, xmin, filebuty1, parentbut_width, 21, &simasel->menu, 0, 0, 0, 0, "");
uiDefBut(block, BUT, B_FS_BOOKMARK, "B", xmin+22, filebuty1, bookmarkbut_width, 21, 0, 0, 0, 0, 0, "Bookmark current directory");
}