[GH-473] Port Font to Editor by pictos · Pull Request #503 · dotnet/maui (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation10 Commits10 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Description of Change
Implements #473
Additions made
- Adds Font property map to EditorHandler
- Adds Font mapping methods to EditorHandlerfor Android and iOS
- Adds extension methods to apply Font on Android/iOS
- Adds DeviceTests for initial Font values on iOS and Android
PR Checklist
- Targets the correct branch
- Tests are passing (or failures are unrelated)
- Targets a single property for a single control (or intertwined few properties)
- Adds the property to the appropriate interface
- Avoids any changes not essential to the handler property
- Adds the mapping to the PropertyMapper in the handler
- Adds the mapping method to the Android, iOS, and Standard aspects of the handler
- Implements the actual property updates (usually in extension methods in the Platform section of Core)
- Tags ported renderer methods with [PortHandler]
- Adds an example of the property to the sample project (MainPage)
- Adds the property to the stub class
- Implements basic property tests in DeviceTests
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks almost perfect but maybe also add the tests from Entry that also check the font size and attributes? Namely the FontSizeInitializesCorrectly
and FontAttributesInitializeCorrectly
tests.
Otherwise this is nice and clean and seems to have all the things.
Thanks!
Also, could you add the entry to the sample MainPage. I know this is now almost impossible to test at this point, but once we got some navigation going this will all be much better.
I mean copy the 2 tests from entry to editor
@mattleibow I see, but when you talk about the MainPage.cs sample, is to add the Editor instead of the entry, right? (Yeah it's a dumb question from me, but just to make sure)
Ah yeah. Editor. 🤦🏻♀️ So menu words looking the same.
public static void MapFont(EditorHandler handler, IEditor editor) |
---|
{ |
var services = App.Current?.Services ?? |
throw new InvalidOperationException($"Unable to find service provider, the App.Current.Services was null."); |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related with this PR, but we have this message repeated in several places. Maybe we can create some specific exceptions like FontInitializationException
or group all the messages etc.
Thanks @pictos. Looks nice, just some small changes and I think is ready.
ghost added the legacy-area-controls
Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor
label