2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

convert to supergroup in all groups

This commit is contained in:
John Preston
2016-03-05 00:04:15 +02:00
parent cb78bd1a10
commit 2bfb1e0f1f
8 changed files with 215 additions and 20 deletions

View File

@@ -212,6 +212,18 @@ QString textcmdStopColor() {
return result.append(TextCommand).append(QChar(TextCommandNoColor)).append(TextCommand);
}
QString textcmdStartSemibold() {
QString result;
result.reserve(3);
return result.append(TextCommand).append(QChar(TextCommandSemibold)).append(TextCommand);
}
QString textcmdStopSemibold() {
QString result;
result.reserve(3);
return result.append(TextCommand).append(QChar(TextCommandNoSemibold)).append(TextCommand);
}
const QChar *textSkipCommand(const QChar *from, const QChar *end, bool canLink) {
const QChar *result = from + 1;
if (*from != TextCommand || result >= end) return from;
@@ -223,6 +235,8 @@ const QChar *textSkipCommand(const QChar *from, const QChar *end, bool canLink)
switch (cmd) {
case TextCommandBold:
case TextCommandNoBold:
case TextCommandSemibold:
case TextCommandNoSemibold:
case TextCommandItalic:
case TextCommandNoItalic:
case TextCommandUnderline:
@@ -498,6 +512,20 @@ public:
}
break;
case TextCommandSemibold:
if (!(flags & TextBlockFSemibold)) {
createBlock();
flags |= TextBlockFSemibold;
}
break;
case TextCommandNoSemibold:
if (flags & TextBlockFSemibold) {
createBlock();
flags &= ~TextBlockFSemibold;
}
break;
case TextCommandItalic:
if (!(flags & TextBlockFItalic)) {
createBlock();