[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11889] branches/imgbrowser-elubie/source/ blender/src: == imagebrowser ==
Andrea Weikert
elubie at gmx.net
Wed Aug 29 23:09:25 CEST 2007
Revision: 11889
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11889
Author: elubie
Date: 2007-08-29 23:09:25 +0200 (Wed, 29 Aug 2007)
Log Message:
-----------
== imagebrowser ==
fix: Tooltips didn't show in imagebrowser
fix: Jumping position for panel with large preview. Now panel has same name for all images since position is stored by the panel title.
Modified Paths:
--------------
branches/imgbrowser-elubie/source/blender/src/drawimasel.c
branches/imgbrowser-elubie/source/blender/src/editimasel.c
Modified: branches/imgbrowser-elubie/source/blender/src/drawimasel.c
===================================================================
--- branches/imgbrowser-elubie/source/blender/src/drawimasel.c 2007-08-29 19:53:49 UTC (rev 11888)
+++ branches/imgbrowser-elubie/source/blender/src/drawimasel.c 2007-08-29 21:09:25 UTC (rev 11889)
@@ -557,16 +557,22 @@
SpaceImaSel *simasel= sa->spacedata.first;
short w = 300;
short h = 300;
+ short offsx, offsy;
+
if (simasel->img) {
w = simasel->img->x;
h = simasel->img->y;
}
+
+ offsx = -150 + (simasel->v2d.mask.xmax - simasel->v2d.mask.xmin)/2;
+ offsy = -150 + (simasel->v2d.mask.ymax - simasel->v2d.mask.ymin)/2;
block= uiNewBlock(&curarea->uiblocks, "imasel_panel_image", UI_EMBOSS, UI_HELV, curarea->win);
uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
uiSetPanelHandler(IMASEL_HANDLER_IMAGE); // for close and esc
- if(uiNewPanel(curarea, block, simasel->file, "Image Browser", 10, 230, w, h)==0) return;
- uiBlockSetDrawExtraFunc(block, imasel_imgdraw);
+ if(uiNewPanel(curarea, block, "Image Preview", "Image Browser", offsx, offsy, w, h)==0)
+ return;
+ uiBlockSetDrawExtraFunc(block, imasel_imgdraw);
}
static void imasel_blockhandlers(ScrArea *sa)
@@ -640,7 +646,7 @@
}
if(menu[0]) { // happens when no .Bfs is there, and first time browse
- uiDefButS(block, MENU,B_FS_DIR_MENU, menu, xmin, filebuty1, bookmarkbut_width, 21, &simasel->menu, 0, 0, 0, 0, "");
+ 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");
}
MEM_freeN(menu);
Modified: branches/imgbrowser-elubie/source/blender/src/editimasel.c
===================================================================
--- branches/imgbrowser-elubie/source/blender/src/editimasel.c 2007-08-29 19:53:49 UTC (rev 11888)
+++ branches/imgbrowser-elubie/source/blender/src/editimasel.c 2007-08-29 21:09:25 UTC (rev 11889)
@@ -1020,11 +1020,11 @@
if (simasel->flag & FILE_BOOKMARKS) {
if(mval[0]>simasel->bookmarkrect.xmin && mval[0]<simasel->bookmarkrect.xmax && mval[1]>simasel->bookmarkrect.ymin && mval[1]<simasel->bookmarkrect.ymax) {
set_active_bookmark(simasel, mval[1]);
+ do_draw= 1;
} else {
simasel->active_bookmark = -1;
- }
- }
- do_draw= 1;
+ }
+ }
}
break;
case AKEY:
@@ -1033,8 +1033,8 @@
do_draw= 1;
break;
case BKEY:
- toggle_blockhandler(curarea, IMASEL_HANDLER_IMAGE, UI_PNL_TO_MOUSE);
- do_draw= 1;
+ toggle_blockhandler(sa, IMASEL_HANDLER_IMAGE, UI_PNL_UNSTOW);
+ scrarea_queue_winredraw(sa);
break;
case PKEY:
if(G.qual & LR_SHIFTKEY) {
@@ -1068,8 +1068,7 @@
}
}
break;
- }
-
+ }
}
else if(event==RIGHTMOUSE) {
simasel->selstate = NOTACTIVE;
More information about the Bf-blender-cvs
mailing list