Tweaked the display and positioning of tooltips so they aren't obscured by the mouse pointer.
This is addressing bug #952
This commit is contained in:
@@ -2836,6 +2836,7 @@ static uiSaveUnder *ui_draw_but_tip(uiBut *but)
|
|||||||
uiSaveUnder *su;
|
uiSaveUnder *su;
|
||||||
float x1, x2, y1, y2;
|
float x1, x2, y1, y2;
|
||||||
|
|
||||||
|
|
||||||
#ifdef INTERNATIONAL
|
#ifdef INTERNATIONAL
|
||||||
if(G.ui_international == TRUE) {
|
if(G.ui_international == TRUE) {
|
||||||
float llx,lly,llz,urx,ury,urz; //for FTF_GetBoundingBox()
|
float llx,lly,llz,urx,ury,urz; //for FTF_GetBoundingBox()
|
||||||
@@ -2844,20 +2845,20 @@ static uiSaveUnder *ui_draw_but_tip(uiBut *but)
|
|||||||
FTF_GetBoundingBox(but->tip, &llx,&lly,&llz,&urx,&ury,&urz, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
|
FTF_GetBoundingBox(but->tip, &llx,&lly,&llz,&urx,&ury,&urz, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
|
||||||
|
|
||||||
x1= (but->x1+but->x2)/2; x2= 10+x1+ but->aspect*FTF_GetStringWidth(but->tip, FTF_USE_GETTEXT | FTF_INPUT_UTF8); //BMF_GetStringWidth(but->font, but->tip);
|
x1= (but->x1+but->x2)/2; x2= 10+x1+ but->aspect*FTF_GetStringWidth(but->tip, FTF_USE_GETTEXT | FTF_INPUT_UTF8); //BMF_GetStringWidth(but->font, but->tip);
|
||||||
y1= but->y1-(ury+FTF_GetSize()); y2= but->y1;
|
y1= but->y1-(ury+FTF_GetSize())-16; y2= but->y1-8;
|
||||||
} else {
|
} else {
|
||||||
FTF_GetBoundingBox(but->tip, &llx,&lly,&llz,&urx,&ury,&urz, FTF_NO_TRANSCONV | FTF_INPUT_UTF8);
|
FTF_GetBoundingBox(but->tip, &llx,&lly,&llz,&urx,&ury,&urz, FTF_NO_TRANSCONV | FTF_INPUT_UTF8);
|
||||||
|
|
||||||
x1= (but->x1+but->x2)/2; x2= 10+x1+ but->aspect*FTF_GetStringWidth(but->tip, FTF_NO_TRANSCONV | FTF_INPUT_UTF8); //BMF_GetStringWidth(but->font, but->tip);
|
x1= (but->x1+but->x2)/2; x2= 10+x1+ but->aspect*FTF_GetStringWidth(but->tip, FTF_NO_TRANSCONV | FTF_INPUT_UTF8); //BMF_GetStringWidth(but->font, but->tip);
|
||||||
y1= but->y1-(ury+FTF_GetSize()); y2= but->y1;
|
y1= but->y1-(ury+FTF_GetSize())-16; y2= but->y1-8;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
x1= (but->x1+but->x2)/2; x2= 10+x1+ but->aspect*BMF_GetStringWidth(but->font, but->tip);
|
x1= (but->x1+but->x2)/2; x2= 10+x1+ but->aspect*BMF_GetStringWidth(but->font, but->tip);
|
||||||
y1= but->y1-19; y2= but->y1+2;
|
y1= but->y1-35; y2= but->y1-6;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
x1= (but->x1+but->x2)/2; x2= 10+x1+ but->aspect*BMF_GetStringWidth(but->font, but->tip);
|
x1= (but->x1+but->x2)/2; x2= 10+x1+ but->aspect*BMF_GetStringWidth(but->font, but->tip);
|
||||||
y1= but->y1-19; y2= but->y1-2;
|
y1= but->y1-35; y2= but->y1-10;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* for pulldown menus it doesnt work */
|
/* for pulldown menus it doesnt work */
|
||||||
@@ -2885,7 +2886,6 @@ static uiSaveUnder *ui_draw_but_tip(uiBut *but)
|
|||||||
|
|
||||||
su= ui_bgnpupdraw((int)(x1-1), (int)(y1-2), (int)(x2+4), (int)(y2+4), 0);
|
su= ui_bgnpupdraw((int)(x1-1), (int)(y1-2), (int)(x2+4), (int)(y2+4), 0);
|
||||||
|
|
||||||
|
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
|
|
||||||
@@ -2907,7 +2907,7 @@ static uiSaveUnder *ui_draw_but_tip(uiBut *but)
|
|||||||
glRectf(x1, y1, x2, y2);
|
glRectf(x1, y1, x2, y2);
|
||||||
|
|
||||||
glColor3ub(0,0,0);
|
glColor3ub(0,0,0);
|
||||||
glRasterPos2f( x1+3, y1+4);
|
glRasterPos2f( x1+3, y1+5);
|
||||||
BIF_DrawString(but->font, but->tip, (U.transopts & USER_TR_TOOLTIPS));
|
BIF_DrawString(but->font, but->tip, (U.transopts & USER_TR_TOOLTIPS));
|
||||||
|
|
||||||
glFinish(); /* to show it in the frontbuffer */
|
glFinish(); /* to show it in the frontbuffer */
|
||||||
|
|||||||
Reference in New Issue
Block a user