Closed HenkKalkwater closed 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.
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 :).
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](https://user-images.githubusercontent.com/4262067/119540868-35c46080-bd8e-11eb-9a2c-991b7af7c835.png)
After this pull request:![image](https://user-images.githubusercontent.com/4262067/119540594-e1b97c00-bd8d-11eb-86d1-59c8d212fed2.png)