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

Commit 74bd832a authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Fix padding in QQS so tiles only move vertically in portrait

The tiles have extra padding on the side, equal to half the inter tile
space. That way, they are aligned with tiles in QS.

Test: manual
Fixes: 175211959

Change-Id: I291efb06a2c4be49535933abcf4d409709b780b2
parent a1d33deb
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -252,11 +252,9 @@ public class QuickQSPanel extends QSPanel {

            final int availableWidth = getMeasuredWidth() - getPaddingStart() - getPaddingEnd();
            final int leftoverWhitespace = availableWidth - maxTiles * mCellWidth;
            final int smallestHorizontalMarginNeeded;
            smallestHorizontalMarginNeeded = leftoverWhitespace / Math.max(1, maxTiles - 1);

            if (smallestHorizontalMarginNeeded > 0){
                mCellMarginHorizontal = smallestHorizontalMarginNeeded;
            if (leftoverWhitespace > 0) {
                mCellMarginHorizontal = leftoverWhitespace / Math.max(1, maxTiles);
                mColumns = maxTiles;
            } else{
                mColumns = mCellWidth == 0 ? 1 :
@@ -266,7 +264,7 @@ public class QuickQSPanel extends QSPanel {
                    mCellMarginHorizontal = (availableWidth - mCellWidth) / 2;
                } else {
                    mCellMarginHorizontal =
                            (availableWidth - mColumns * mCellWidth) / (mColumns - 1);
                            (availableWidth - mColumns * mCellWidth) / mColumns;
                }

            }
@@ -310,7 +308,8 @@ public class QuickQSPanel extends QSPanel {
                // Only one column/tile. Use the margin to center the tile.
                return getPaddingStart() + mCellMarginHorizontal;
            }
            return getPaddingStart() + column *  (mCellWidth + mCellMarginHorizontal);
            return getPaddingStart() + mCellMarginHorizontal / 2
                    + column *  (mCellWidth + mCellMarginHorizontal);
        }

        @Override