accumulator / Quickddit

Reddit client for Jolla's SailfishOS, Ubuntu Touch and Nokia N9
GNU General Public License v3.0
53 stars 21 forks source link

Ubuntu Touch: Change hard-coded sizes into Suru units #84

Closed HenkKalkwater closed 3 years ago

HenkKalkwater commented 3 years ago

This change will make the application respect the scaling in Lomiri. I usually tried to round towards the nearest grid unit (8px by default), so the sizes of elements may not exactly be as they were.

This change is most noticeable when you change the element size in the Ubuntu Touch Tweak Tool, as I did for my PinePhone.

Before this pull request: screenshot20210525_160628975

After this pull request: image

dano6 commented 3 years ago

There is pinephone bug, where autoscaling didn't work, so lets use this for now. Later I would love to not require Suru style and support multiple styles, but that is for future.

HenkKalkwater commented 3 years ago

Perhaps a singelton QtObject with size and other constants could be introduced, say /Style.qml? That way, for Ubuntu Touch, you could override it with Suru units by creating a /+suru/Style.qml resource (see the QtQuick documentation about file selectors) which uses the Suru grid units. That way, you should be able to remove the Suru imports from all the other files.

To be fair, that would improve the code as it currently is as well in my opinion, since almost all explicitly set sizes were magic numbers and with this pull request, kind of still are :).