#include "unicodedialog.h"
+#include <QWheelEvent>
+
/// CONSTANTS
const int MAX_LENGTH_HEX = 4;
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;
} else if (u == "266c") {
infoText = i18n("Sixteenth note (Am.) or semiquaver (Brit.). Half as long as an eighth note (U+266a). See <a href=\"http://en.wikipedia.org/wiki/Sixteenth_note\">Wikipedia:Sixteenth_note</a>");
} else if (u == "1D162") {
- infoText = i18n("Thirty-second note (Am.) or demisemiquaver (Brit.). Half as long as a sixteenth note (U+266b). See <a href=\"http://en.wikipedia.org/wiki/Quarter_note\">Wikipedia:Thirty-second_note</a>");
+ infoText = i18n("Thirty-second note (Am.) or demisemiquaver (Brit.). Half as long as a sixteenth note (U+266b). See <a href=\"http://en.wikipedia.org/wiki/Thirty-second_note\">Wikipedia:Thirty-second_note</a>");
} else {
infoText = i18n("<small>No additional information available for this character.</small>");
}
for (i = 1; i <= 4; i++) {
if (unicode > i && !controlCharacter(unicode - i)) {
- left = " " + left;
+ left = ' ' + left;
left = QChar(unicode - i) + left;
}
}
for (i = 1; i <= 8; i++) {
if (unicode + i <= MAX_UNICODE_V1 && !controlCharacter(unicode + i)) {
right += QChar(unicode + i);
- right += " ";
+ right += ' ';
}
}
unicodeNumber->setText(nextUnicode(text, Backward));
}
+void UnicodeDialog::wheelEvent(QWheelEvent * event)
+{
+ if (frame->underMouse()) {
+ if (event->delta() > 0) slotNextUnicode();
+ else slotPrevUnicode();
+ }
+}
+
#include "unicodedialog.moc"