Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3e3c533 authored by Adam Powell's avatar Adam Powell
Browse files

Fix bug 4807086 - Options menu panel too narrow in landscape

Now that landscape on phones uses the config_prefDialogWidth setting
to restrict the default size of dialog windows, the options menu panel
was affected.

Restrict the ratcheting preferred width feature based on the width
LayoutParam only, and respect the LayoutParams width provided by panel
windows.

Change-Id: Idc62f41910f6f22dc50cab978c5642bb0a8dbdaf
parent 8969d992
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1000,8 +1000,7 @@ public final class ViewAncestor extends Handler implements ViewParent,
                    + "x" + desiredWindowHeight + "...");

            boolean goodMeasure = false;
            if (lp.width == ViewGroup.LayoutParams.WRAP_CONTENT
                    || lp.height == ViewGroup.LayoutParams.WRAP_CONTENT) {
            if (lp.width == ViewGroup.LayoutParams.WRAP_CONTENT) {
                // On large screens, we don't want to allow dialogs to just
                // stretch to fill the entire width of the screen to display
                // one line of text.  First try doing the layout at a smaller
+3 −1
Original line number Diff line number Diff line
@@ -498,6 +498,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
            return;
        }

        int width = WRAP_CONTENT;
        if (st.decorView == null || st.refreshDecorView) {
            if (st.decorView == null) {
                // Initialize the panel decor, this will populate st.decorView
@@ -523,6 +524,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
                // If the contents is fill parent for the width, set the
                // corresponding background
                backgroundResId = st.fullBackground;
                width = MATCH_PARENT;
            } else {
                // Otherwise, set the normal panel background
                backgroundResId = st.background;
@@ -546,7 +548,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
        st.isHandled = false;

        WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
                WRAP_CONTENT, WRAP_CONTENT,
                width, WRAP_CONTENT,
                st.x, st.y, WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG,
                WindowManager.LayoutParams.FLAG_DITHER
                | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM