зеркало из https://github.com/mozilla/pjs.git
bug 73970 - Tooltips disappear when at bottom of screen
Actually just fixes tooltips so they don't flip to the left of the mouse pointer when they extend off the right edge of the screen. r=me, sr=bryner@netscape.com patch by zipo13@myrealbox.com
This commit is contained in:
Родитель
0e48c7de27
Коммит
c50a22b86b
|
@ -1238,12 +1238,12 @@ nsMenuPopupFrame::SyncViewWithFrame(nsIPresContext* aPresContext,
|
||||||
|
|
||||||
// ensure it is not even partially offscreen.
|
// ensure it is not even partially offscreen.
|
||||||
if ( (screenViewLocX + mRect.width) > screenRightTwips ) {
|
if ( (screenViewLocX + mRect.width) > screenRightTwips ) {
|
||||||
// as a result of moving the popup, it might end up under the mouse. This
|
if (tag == nsXULAtoms::tooltip) {
|
||||||
// would be bad as the subsequent mouse_up would trigger whatever
|
//the tooltip is off the screen to the right - shift it to the left as much as needed
|
||||||
// unsuspecting item happens to be at that position. To get around this, make
|
xpos -= (screenViewLocX + mRect.width) - screenRightTwips;
|
||||||
// move it so the right edge is where the mouse is, as we're guaranteed
|
}
|
||||||
// that the mouse is on the screen!
|
else
|
||||||
xpos -= mRect.width;
|
xpos -= mRect.width;
|
||||||
}
|
}
|
||||||
if ( (screenViewLocY + mRect.height) > screenBottomTwips )
|
if ( (screenViewLocY + mRect.height) > screenBottomTwips )
|
||||||
ypos -= (mRect.height + margin.top + margin.bottom);
|
ypos -= (mRect.height + margin.top + margin.bottom);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче