[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11940] trunk/blender/source/blender/src: == imagebrowser ==

Andrea Weikert elubie at gmx.net
Tue Sep 4 21:07:51 CEST 2007


Revision: 11940
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11940
Author:   elubie
Date:     2007-09-04 21:07:51 +0200 (Tue, 04 Sep 2007)

Log Message:
-----------
== imagebrowser ==
- nicer drawing of highlight for bookmarks
- fix slight positioning issue of bookmark highlight
- resetting bookmark highlight when mouse outside bookmark area
- cleaned up define that isn't needed anymore

Modified Paths:
--------------
    trunk/blender/source/blender/src/drawimasel.c
    trunk/blender/source/blender/src/editimasel.c

Modified: trunk/blender/source/blender/src/drawimasel.c
===================================================================
--- trunk/blender/source/blender/src/drawimasel.c	2007-09-04 17:42:33 UTC (rev 11939)
+++ trunk/blender/source/blender/src/drawimasel.c	2007-09-04 19:07:51 UTC (rev 11940)
@@ -30,12 +30,6 @@
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
 
-#ifdef __sgi
-#define OLD_IMASEL	1
-#else
-#define OLD_IMASEL	0
-#endif
-
 #include <string.h>
 
 #ifdef HAVE_CONFIG_H
@@ -278,7 +272,15 @@
 				}
 				sname = &bookmark[sl];
 				sw = shorten_string(simasel, sname, bmwidth);
+
+				
 				if (simasel->active_bookmark == i ) {
+					glEnable(GL_BLEND);
+					glColor4ub(0, 0, 0, 100);
+					glDisable(GL_BLEND);
+					BIF_ThemeColor(TH_HILITE);
+					uiSetRoundBox(15);	
+					uiRoundBox(simasel->bookmarkrect.xmin + TILE_BORDER_X - 1, sy - linestep*0.25, simasel->bookmarkrect.xmax - TILE_BORDER_X + 1, sy + linestep*0.75, 6);
 					BIF_ThemeColor(TH_TEXT_HI);
 				} else {
 					BIF_ThemeColor(TH_TEXT);

Modified: trunk/blender/source/blender/src/editimasel.c
===================================================================
--- trunk/blender/source/blender/src/editimasel.c	2007-09-04 17:42:33 UTC (rev 11939)
+++ trunk/blender/source/blender/src/editimasel.c	2007-09-04 19:07:51 UTC (rev 11940)
@@ -325,8 +325,8 @@
 static void set_active_bookmark(SpaceImaSel *simasel, short y)
 {
 	int nentries = fsmenu_get_nentries();
-	short posy = simasel->bookmarkrect.ymax - U.fontsize*3/2 - TILE_BORDER_Y - y;
-	simasel->active_bookmark = ((float)posy / (U.fontsize*3.0f/2.0f)) + 0.5;	
+	short posy = simasel->bookmarkrect.ymax - TILE_BORDER_Y - y;
+	simasel->active_bookmark = ((float)posy / (U.fontsize*3.0f/2.0f));	
 	if (simasel->active_bookmark < 0 || simasel->active_bookmark > nentries) {
 		simasel->active_bookmark = -1;
 	}
@@ -1005,6 +1005,7 @@
 			getmouseco_areawin(mval);
 			if(mval[0]>simasel->viewrect.xmin && mval[0]<simasel->viewrect.xmax && mval[1]>simasel->viewrect.ymin && mval[1]<simasel->viewrect.ymax) {
 				set_active_file(simasel, mval[0], mval[1]);
+				simasel->active_bookmark = -1;
 				if(simasel->active_file >=0 && simasel->active_file<numfiles) {
 					file = BIF_filelist_file(simasel->files, simasel->active_file);
 					if (simasel->selstate == INACTIVATE) {
@@ -1016,15 +1017,15 @@
 					do_draw= 1;
 				}
 			} else {
-				simasel->active_file = -1;
+				simasel->active_file = -1;			
 				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;
+						set_active_bookmark(simasel, mval[1]);						
 					} else {
 						simasel->active_bookmark = -1;
-					}					
-				}				
+					}
+					do_draw= 1;
+				}
 			}
 			break;
 		case AKEY:





More information about the Bf-blender-cvs mailing list