-
Notifications
You must be signed in to change notification settings - Fork 44
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
New, more modern KivaFont trait #929
Conversation
This font editor is laregly toolkit independent - it embeds a Window with a Label component to display the font and the simple editor uses the Pyface font dialog to get new font values. Some functionality is broken out into experimental base classes for building editors with components.
This creates a KivaFont TraitType, which is: - in enable, rather than Kiva, meaning Kiva can potentially not need traits - has a better font parser that supports more weight types - the font parser can be swapped out for something better easily - uses the new KivaFontEditor, which is available for Qt - converts Pyface Fonts to Kiva Fonts
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.
Some preliminary comments
@@ -10,181 +10,7 @@ | |||
""" Trait definition for a wxPython-based Kiva font. | |||
""" | |||
|
|||
import logging | |||
from enable.trait_defs.kiva_font_trait import KivaFont as _KivaFont |
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.
Are you sure we want to import from enable
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.
Yes, I think so. It's preliminary to getting rid of kiva.trait_defs
.
As long as we don't have circularity of imports it should be fine.
@mdickinson if you have time to review, this would be great. |
Will review first thing tomorrow. Please could you fix the conflicts first? |
Hopefully done - I'm at the point today where I am messing things up. |
Looks like some imports got mangled/moved in the merge. Not entirely sure how the tests are passing right now. Edit: because tests for trait defs weren't in a package (no |
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.
Done with first-pass review. Lots of comments, mostly at nitpick level.
At some point, it would be great to get flake8-style checks up and running on this repository; it's more efficient at catching things like NameError
s than humans are.
docs/source/enable/traits.rst
Outdated
@@ -18,7 +18,7 @@ the form of an HTML color name ("blue" or "#0000FF"). | |||
|
|||
font_trait | |||
---------- | |||
:class:`~.font_trait` is a synonym for :class:`kiva.trait_defs.api.KivaFont`. | |||
:class:`~.font_trait` is a synonym for :class:`enable.trait_defs.kiva_font_trait.KivaFont`. |
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.
Nits:
- Rewrap to avoid long lines? The rest of the file seems to be limited to width 80.
- The statement seems misleading:
font_trait
is an instance ofKivaFont
, rather than a synonym for it. Worth rephrasing?
Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
I think that's everything addressed; assuming tests pass, this is ready for re-review. |
This comment was marked as outdated.
This comment was marked as outdated.
Aargh; sorry. I was somehow seeing out-of-date code in GitHub. All looks good. |
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.
LGTM
This creates a KivaFont TraitType, which is:
This requires #928 to be merged before it is.
In conjunction with #924 this closes #417
It also closes #922 and closes #896 and closes #471