Commit ffd46709 authored by David Precious's avatar David Precious Committed by Albert Astals Cid

Show upper & lowercase letters in KLettres

I've started using KLettres to help teach my little boy to recognise letters and associate their sounds, and to find them on the keyboard, and I'm finding KLettres most useful - so thank you!

One point I notice that makes it a little tricky is the difference between the upper-case letter displayed, and the lower-case version on the kid-friendly keyboard I got him (in hindsight, I kinda wish I'd got an alternative model which has both upper and lowercase labels!)

I think it'd be a really useful if KLettres displayed both the upper and lowercase version of the letter, e.g. "A / a" - both to teach the association that both of those are the same letter, even though they look a bit different, and also to make it easier to match with the label on the keyboard.

What do you think?  I'm mostly a backend Perl guy at heart, so I'm sure there's a cleaner/better way to do it than what I've done, but I've tested it and it does work.

The only potential sticking point I can see is that for some writing systems, upper/lower case might not make sense for certain scripts - Arabic/Hebrew etc, as far as I'm aware, don't really have a concept of capital letters.  That said, I don't think any such unicameral scripts are currently supported - but I've made it only append the lowercase version if toLower() returned  something different, so it should be safe if any are added in future.

Reviewers: mlaurent

Subscribers: aacid, shubham, narvaez, apol, kde-edu

Tags: #kde_edu

Differential Revision:
parent b6f95b0b
......@@ -139,9 +139,13 @@ void KLettresView::paintLetter(QPainter &p, const QRect& rect)
if (!myRect.intersects(rect)) {
const QString letterInLower = m_currentLetter.toLower();
const QString prompt = (letterInLower == m_currentLetter) ? m_currentLetter
: i18nc("%1 is uppercase letter, %2 is the same in lowercase", "%1 / %2", m_currentLetter, letterInLower);
p.setPen( m_theme->letterColor());
p.drawText(myRect, m_currentLetter);
p.drawText(myRect, prompt);
m_letterEdit->setGeometry( m_theme->inputRect(size()));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment