typedb / typedb-studio

TypeDB Studio (IDE)
https://typedb.com
Mozilla Public License 2.0
191 stars 44 forks source link

Fix icon clipping #664

Closed jamesreprise closed 1 year ago

jamesreprise commented 1 year ago

What is the goal of this PR?

We've fix a bug we introduced a bug in:

where the size of icons was initialised as "Unspecified". As a result, certain icons became 'clipped', see:

image

We believe the cause of this is that the function .sp doesn't have enough information in order to construct a TextUnit value at the time that the object is constructed. As such, it gives a TextUnit value of "Unspecified".

What are the changes implemented in this PR?

The only other place we use .sp in our application is in //framework/common/theme/Typography.kt, where we follow the pattern of declaring our sizes as const Ints and transforming them into TextUnit values later with .sp. We now follow this pattern in //framework/material/Icon.kt

We've also made all the Icon enum class constructor arguments named.

typedb-bot commented 1 year ago

PR Review Checklist

Do not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed.


Code

Architecture