X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Funicodedialog.cpp;h=7576c3b2c9d7258c0c05722c79984f8c7096764b;hb=8d1e6aae86d4a2b7f22658d4d94c6a4857c9eb19;hp=b721cb590bce243a987c2225a97a3c5e113bc474;hpb=add1e383da165d17af496985f5dd090e8c6deea1;p=kdenlive diff --git a/src/unicodedialog.cpp b/src/unicodedialog.cpp index b721cb59..7576c3b2 100644 --- a/src/unicodedialog.cpp +++ b/src/unicodedialog.cpp @@ -9,6 +9,8 @@ #include "unicodedialog.h" +#include + /// CONSTANTS const int MAX_LENGTH_HEX = 4; @@ -78,7 +80,7 @@ bool UnicodeDialog::controlCharacter(QString text) switch (inputMethod) { case InputHex: - if (t == "" + if (t.isEmpty() || (t.length() == 1 && !(t == "9" || t == "a" || t == "d")) || (t.length() == 2 && t.at(0) == QChar('1'))) { isControlCharacter = true; @@ -169,7 +171,7 @@ QString UnicodeDialog::unicodeInfo(QString unicode) } else if (u == "266c") { infoText = i18n("Sixteenth note (Am.) or semiquaver (Brit.). Half as long as an eighth note (U+266a). See Wikipedia:Sixteenth_note"); } else if (u == "1D162") { - infoText = i18n("Thirty-second note (Am.) or demisemiquaver (Brit.). Half as long as a sixteenth note (U+266b). See Wikipedia:Thirty-second_note"); + infoText = i18n("Thirty-second note (Am.) or demisemiquaver (Brit.). Half as long as a sixteenth note (U+266b). See Wikipedia:Thirty-second_note"); } else { infoText = i18n("No additional information available for this character."); } @@ -208,7 +210,7 @@ void UnicodeDialog::updateOverviewChars(uint unicode) for (i = 1; i <= 4; i++) { if (unicode > i && !controlCharacter(unicode - i)) { - left = " " + left; + left = ' ' + left; left = QChar(unicode - i) + left; } } @@ -216,7 +218,7 @@ void UnicodeDialog::updateOverviewChars(uint unicode) for (i = 1; i <= 8; i++) { if (unicode + i <= MAX_UNICODE_V1 && !controlCharacter(unicode + i)) { right += QChar(unicode + i); - right += " "; + right += ' '; } } @@ -366,4 +368,12 @@ void UnicodeDialog::slotPrevUnicode() unicodeNumber->setText(nextUnicode(text, Backward)); } +void UnicodeDialog::wheelEvent(QWheelEvent * event) +{ + if (frame->underMouse()) { + if (event->delta() > 0) slotNextUnicode(); + else slotPrevUnicode(); + } +} + #include "unicodedialog.moc"