-
-
Notifications
You must be signed in to change notification settings - Fork 907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ALOY-1547] Added support for setting font from Alloy xml view #764
Conversation
if (args.createArgs && (args.createArgs.fontSize || args.createArgs.fontStyle || args.createArgs.fontFamily || args.createArgs.fontWeight || args.createArgs.textStyle)) { | ||
args.createArgs.font = args.createArgs.font || {}; | ||
_.defaults(args.createArgs.font, { | ||
fontSize: args.createArgs.fontSize || args.createArgs.font.fontSize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think font.fontSize should come first
Also, where are the others here?
I like the idea but have two notes:
|
@brentonhouse could you create a JIRA ticket so we can discuss this beyond code? |
Sorry, I should have linked to the JIRA ticket. Here it is: https://jira.appcelerator.org/browse/AC-696 |
I was thinking that font.fontSize might come from the style (which would be overwritten) but they will come in the separate style objects. I can change it and add it to the PR. |
I like the idea of using xml prefixes to distinguish things. I think that would have been a good way to implement module and namespace support in Alloy tags. Are there a lot of other child object, other than font, that need to be set in xml? I noticed that setting font seems to be one of the few commonly used properties that can't be set currently using the normal xml attributes. |
-deleted- Let's continue discussion on https://jira.appcelerator.org/browse/AC-696 |
Just curious if this has any life left in it... I've gotta say this is still probably one of my number one things I have to workaround with Titanium. A lot of times I am trying to quickly create views and I just want to be able to change the fontFamily or fontSize in the xml instead of having to create a I work around this by always using custom |
@feons @ewanharris - is there anything that would keep us from merging this before the next Alloy release? |
Lets review, document and merge this please. We would use it at Lambus as well, really good feature for clean XML definitions |
@brentonhouse, I'd like to find some time take a read through the related tickets/discussions before moving on this. I don't see this making into the next Alloy release in CLI 7.0.10 |
@ewanharris Any update here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that #765 exists my preference here is to take that solution over this one. I'm not that comfortable with adding special handling of the font settings and the precedence this sets for allowing similar properties in future that might cause us headaches further down the line if a potential naming collision occurs.
@brentonhouse, @hansemannn do you have any objections to the above? Would you be fine with considering this solved by #765? |
I personally strongly prefer |
My preference is to have both (i.e. fontFamily and font.Family) but I know I am in the minority on that one. On the |
I agree with Brenton in that I prefer dot notation here, I do agree it's not as XML-y but it does align more with what's being done (i.e. setting a key of an object). I guess it could be argued that the usage in an ItemTemplate is maybe more in line with the platform namespacing added in #922 |
Going to close this one out in favour of #765 |
https://jira.appcelerator.org/browse/ALOY-1547
https://jira.appcelerator.org/browse/ALOY-1363