mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1151505 - Adjust for tablet anchoring being offscreen. r=margaret
This commit is contained in:
parent
f8aba2d7c9
commit
f819cfe75e
@ -6,7 +6,7 @@
|
||||
<resources>
|
||||
|
||||
<dimen name="arrow_popup_container_width">400dp</dimen>
|
||||
<dimen name="doorhanger_offsetY">126dp</dimen>
|
||||
<dimen name="doorhanger_offsetY">124dp</dimen>
|
||||
|
||||
<dimen name="browser_toolbar_height">56dp</dimen>
|
||||
<dimen name="browser_toolbar_height_flipper">60dp</dimen>
|
||||
|
@ -103,7 +103,7 @@
|
||||
<dimen name="doorhanger_input_width">250dp</dimen>
|
||||
<dimen name="doorhanger_spinner_textsize">9sp</dimen>
|
||||
<dimen name="doorhanger_padding">15dp</dimen>
|
||||
<dimen name="doorhanger_offsetX">10dp</dimen>
|
||||
<dimen name="doorhanger_offsetX">12dp</dimen>
|
||||
<dimen name="doorhanger_offsetY">67dp</dimen>
|
||||
<dimen name="doorhanger_GB_offsetY">7dp</dimen>
|
||||
<dimen name="doorhanger_drawable_padding">5dp</dimen>
|
||||
|
@ -113,12 +113,19 @@ public abstract class AnchoredPopup extends PopupWindow {
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean validAnchor = (mAnchor != null) && (anchorLocation[1] > 0);
|
||||
if (HardwareUtils.isTablet()) {
|
||||
showAsDropDown(mAnchor, 0, 0);
|
||||
if (validAnchor) {
|
||||
showAsDropDown(mAnchor, 0, 0);
|
||||
} else {
|
||||
// The anchor will be offscreen if the dynamic toolbar is hidden, so anticipate the re-shown position
|
||||
// of the toolbar.
|
||||
final int offsetX = mContext.getResources().getDimensionPixelOffset(R.dimen.doorhanger_offsetX);
|
||||
showAtLocation(decorView, Gravity.TOP | Gravity.LEFT, offsetX, offsetY);
|
||||
}
|
||||
} else {
|
||||
// If the anchor is null or out of the window bounds, just show the popup at the top of the
|
||||
// root view.
|
||||
final boolean validAnchor = (mAnchor != null) && (anchorLocation[1] > 0);
|
||||
final View anchor = validAnchor ? mAnchor : decorView;
|
||||
|
||||
showAtLocation(anchor, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, offsetY);
|
||||
|
Loading…
Reference in New Issue
Block a user