-
Notifications
You must be signed in to change notification settings - Fork 29
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
SVG view improvements #87
Conversation
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.
Thanks for your contribution. It’s simple and efficient, I like that a lot. :-)
It works as is, but I’ve let a couple nitpicks that you may address if you will in order to further improve the code readability and expressiveness.
/* Adding Base class option to display Alpha + dk layers */ | ||
.base .level3, .base .level4 { display: none;} | ||
.base .level5 { opacity: 0.5; display: block;} | ||
|
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’m not sure whether I prefer 1dk
over base
for this class name, but base
is consistent with the TOML layer description, indeed.
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.
Up to you,
I think the dk already exists, and show all level 5 and 6.
I think that the layout is better described with alpha and a trimed dk layer for a quick overview of the layout.
In fact, I find it more useful on Ergo-L / Bépolar type of layout than the alpha+AltGr that is output by default.
if dead_char_previous := main_deadkey.get(chars[0]): | ||
if upper_key(dead_char_previous) == dead_char: | ||
# Do not print letters twice (lower and upper) | ||
continue |
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.
Great addition. Nitpick: this comment would make more sense above the whole code block (line 511)
kalamine/layout.py
Outdated
|
||
# Print 5-6 levels (1dk deadkeys) | ||
if deadkeys and (main_deadkey := deadkeys.get("**")): | ||
for level_num, char in enumerate(chars[:2], start=5): | ||
if dead_char := main_deadkey.get(char): | ||
dead_char = main_deadkey.get(char) | ||
if level_num == 6: |
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.
We’ve recently added a layer enumerator that you could use here:
if level_num == Layer.ODK_SHIFT:
kalamine/layout.py
Outdated
location.set( | ||
"class", location.get("class") + " deadKey diacritic" | ||
) | ||
print_char(location, char) | ||
|
||
# Print 5-6 levels (1dk deadkeys) | ||
if deadkeys and (main_deadkey := deadkeys.get("**")): | ||
for level_num, char in enumerate(chars[:2], start=5): |
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’ve recently added a layer enumerator but I’ve totally missed this line. You could apply it here:
for level_num, char in enumerate(chars[:2], start=Layer.ODK):
Co-authored-by: Cèd’C <[email protected]>
Co-authored-by: Cèd’C <[email protected]>
Co-authored-by: Cèd’C <[email protected]>
Improving svg classical deadkeys: removing
*
prefix and setting they in red.Adding a
base
class on css to dispaly Alpha keys and deadkey layer.