Commit c757fb32 authored by Jeremy Whiting's avatar Jeremy Whiting
Browse files

Convert all letters to upper case to compare.

BUG: 362193
Since special characters for each language in khangman language.txt
files are lower case, but we show upper case in the gui special
characters were not properly getting marked as disabled or being
marked green or red when clicked. To fix always compare
upper case version of letters.
Note: if I changed letter button letter property to modelData.toUpperCase
some German characters were shown incorrectly in the gui, so show the
modelData with capitalization font, but compare toUpperCase() behind
the scenes.
parent c591cfba
......@@ -73,7 +73,7 @@ Item {
function disableLetterButton(letter) {
for (var i = 0; i < alphabetLetterRepeater.count; ++i) {
if (alphabetLetterRepeater.itemAt(i).letter === letter) {
if (alphabetLetterRepeater.itemAt(i).upperCase == letter) {
alphabetLetterRepeater.itemAt(i).enabled = false;
break;
}
......@@ -121,7 +121,7 @@ Item {
function changeButtonColor(letter) {
for (var i = 0; i < alphabetLetterRepeater.count; ++i) {
if (alphabetLetterRepeater.itemAt(i).letter == letter) {
if (alphabetLetterRepeater.itemAt(i).upperCase == letter) {
alphabetLetterRepeater.itemAt(i).buttonColor = khangman.containsChar(letter) ? "green" : "red";
}
}
......@@ -520,6 +520,7 @@ Item {
Button {
id: alphabetButton;
property string letter: modelData
property string upperCase: modelData.toUpperCase()
property string buttonColor: "black"
style: ButtonStyle {
......
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