зеркало из 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.
|
||||
if ( (screenViewLocX + mRect.width) > screenRightTwips ) {
|
||||
// as a result of moving the popup, it might end up under the mouse. This
|
||||
// would be bad as the subsequent mouse_up would trigger whatever
|
||||
// unsuspecting item happens to be at that position. To get around this, make
|
||||
// move it so the right edge is where the mouse is, as we're guaranteed
|
||||
// that the mouse is on the screen!
|
||||
xpos -= mRect.width;
|
||||
if (tag == nsXULAtoms::tooltip) {
|
||||
//the tooltip is off the screen to the right - shift it to the left as much as needed
|
||||
xpos -= (screenViewLocX + mRect.width) - screenRightTwips;
|
||||
}
|
||||
else
|
||||
xpos -= mRect.width;
|
||||
}
|
||||
if ( (screenViewLocY + mRect.height) > screenBottomTwips )
|
||||
ypos -= (mRect.height + margin.top + margin.bottom);
|
||||
|
|
Загрузка…
Ссылка в новой задаче