Text style editing dialog forcefully sets font when it is not previously defined
|Assignee:||Tuukka Lehtonen||% Done:|
|Release notes:||Edit Style dialog no longer forcefully sets a font when -- keep current font -- is selected from the font list|
|Velocity based estimate||-|
|Release||Simantics 1.18.1||Release relationship||Auto|
If a generic text element does not define a G2D.HasFont property at all, the diagram text element implementation defaults to using (Arial, Plain, 12) font.
However, if the user tries to edit the style of such a text element, the style editing dialog forces the user to select a font from the font list even if the user only wanted to set the text color.Two simple solutions come to mind:
- If font is not defined, default to the same (Arial, Plain, 12). The problem with this is that it is just a default that could change thus potentially breaking the dialog again in the future.
- Add an option -- keep current font-- as the first entry of the font list. This will work in both cases: when font is defined and when it is not. If not defined, the dialog will simply not set the font upon OK.
Decided to go with option 2.
At the same time, I'm removing the font setting from the dialog's font list because it makes the list less readable and for some fonts, the name is barely readable at all.