Make sure that the style menu shows the right style name for code and quote.
Also when in quote mode the valid styles are now transformed to how they look in quote to show they are valid. Clicking quote style again in a quote block will return to paragrpah style from heading now
This commit is contained in:
@@ -9,30 +9,45 @@
|
||||
|
||||
#include <KLocalizedString>
|
||||
|
||||
QString RichFormat::styleString(Format format)
|
||||
QString RichFormat::styleString(Format format, bool inQuoteBlock)
|
||||
{
|
||||
QString formatString;
|
||||
switch (format) {
|
||||
case Paragraph:
|
||||
return i18nc("As in the default paragraph text style in the chat bar", "Paragraph Style");
|
||||
formatString = i18nc("As in the default paragraph text style in the chat bar", "Paragraph Style");
|
||||
break;
|
||||
case Heading1:
|
||||
return i18nc("As in heading level 1 text style in the chat bar", "Heading 1");
|
||||
formatString = i18nc("As in heading level 1 text style in the chat bar", "Heading 1");
|
||||
break;
|
||||
case Heading2:
|
||||
return i18nc("As in heading level 2 text style in the chat bar", "Heading 2");
|
||||
formatString = i18nc("As in heading level 2 text style in the chat bar", "Heading 2");
|
||||
break;
|
||||
case Heading3:
|
||||
return i18nc("As in heading level 3 text style in the chat bar", "Heading 3");
|
||||
formatString = i18nc("As in heading level 3 text style in the chat bar", "Heading 3");
|
||||
break;
|
||||
case Heading4:
|
||||
return i18nc("As in heading level 4 text style in the chat bar", "Heading 4");
|
||||
formatString = i18nc("As in heading level 4 text style in the chat bar", "Heading 4");
|
||||
break;
|
||||
case Heading5:
|
||||
return i18nc("As in heading level 5 text style in the chat bar", "Heading 5");
|
||||
formatString = i18nc("As in heading level 5 text style in the chat bar", "Heading 5");
|
||||
break;
|
||||
case Heading6:
|
||||
return i18nc("As in heading level 6 text style in the chat bar", "Heading 6");
|
||||
formatString = i18nc("As in heading level 6 text style in the chat bar", "Heading 6");
|
||||
break;
|
||||
case Code:
|
||||
return i18nc("As in code text style in the chat bar", "Code");
|
||||
formatString = i18nc("As in code text style in the chat bar", "Code");
|
||||
break;
|
||||
case Quote:
|
||||
return i18nc("As in quote text style in the chat bar", "\"Quote\"");
|
||||
if (inQuoteBlock) {
|
||||
formatString = i18nc("As in the default paragraph text style inside a quote block in the chat bar", "Quote Paragraph Style");
|
||||
break;
|
||||
}
|
||||
formatString = i18nc("As in quote text style in the chat bar", "Quote");
|
||||
break;
|
||||
default:
|
||||
return {};
|
||||
break;
|
||||
}
|
||||
return u"%1%2%1"_s.arg(inQuoteBlock && !(format == Paragraph || format == Code) ? u"\""_s : u""_s, formatString);
|
||||
};
|
||||
|
||||
RichFormat::FormatType RichFormat::typeForFormat(Format format)
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
*
|
||||
* @sa Format
|
||||
*/
|
||||
static QString styleString(Format format);
|
||||
static QString styleString(Format format, bool inQuoteBlock = false);
|
||||
|
||||
/**
|
||||
* @brief Return the FormatType for the Format.
|
||||
|
||||
Reference in New Issue
Block a user