X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Funicodedialog.cpp;h=7576c3b2c9d7258c0c05722c79984f8c7096764b;hb=8fc16957ff5417b21e68ca5d84de89bec38c5a1c;hp=f1e9207b8357c12d02cada5badc2cacbe177400f;hpb=c160571e8a425d3ca936c9f9ca2d3b1660bd9d70;p=kdenlive diff --git a/src/unicodedialog.cpp b/src/unicodedialog.cpp index f1e9207b..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; @@ -153,7 +155,7 @@ QString UnicodeDialog::unicodeInfo(QString unicode) } else if (u == "2013") { infoText = i18n("

An en Dash (dash of the width of an n).

Usage examples: In English language for value ranges (1878–1903), for relationships/connections (Zurich–Dublin). In the German language it is also used (with spaces!) for showing thoughts: “Es war – wie immer in den Ferien – ein regnerischer Tag.

See Wikipedia:Dash

"); } else if (u == "2014") { - infoText = i18n("

An em Dash (dash of the widht of an m).

Usage examples: In English language to mark—like here—thoughts. Traditionally without spaces.

See Wikipedia:Dash

"); + infoText = i18n("

An em Dash (dash of the width of an m).

Usage examples: In English language to mark—like here—thoughts. Traditionally without spaces.

See Wikipedia:Dash

"); } else if (u == "202f") { infoText = i18n("

Narrow no-break space. Has the same width as U+2009.

Usage: For units (spaces are marked with U+2423, ␣): 230␣V, −21␣°C, 50␣lb, but 90° (no space). In German for abbreviations (like: i. d. R. instead of i. d. R. with U+00a0).

See Wikipedia:de:Schmales_Leerzeichen

"); } else if (u == "2026") { @@ -164,12 +166,12 @@ QString UnicodeDialog::unicodeInfo(QString unicode) infoText = i18n("Open box; stands for a space."); } else if (u == "2669") { infoText = i18n("Quarter note (Am.) or crochet (Brit.). See Wikipedia:Quarter_note"); - } else if (u == "266a") { + } else if (u == "266a" || u == "266b") { infoText = i18n("Eighth note (Am.) or quaver (Brit.). Half as long as a quarter note (U+2669). See Wikipedia:Eighth_note"); - } else if (u == "266b") { - infoText = i18n("Sixteenth note (Am.) or semiquaver (Brit.). Half as long as an eighth note (U+266a). See Wikipedia:Sixteenth_note"); } else if (u == "266c") { - 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("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"); } 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"