Add message formatting help beside Join with a fenced code example
This commit is contained in:
1 parent
be7421e6e2
commit
f147f346d5
3 files changed
+34
No files matched your search
@@ -20,6 +20,7 @@
|
||||
#include <QUrl>
|
||||
#include <QSignalBlocker>
|
||||
#include <QToolTip>
|
||||
#include <QMessageBox>
|
||||
|
||||
extern "C" {
|
||||
#include "../../lib/debug_config.h"
|
||||
@@ -281,6 +282,29 @@ ChannelList::ChannelList(DbManager* db, QWidget *parent)
|
||||
plusBtn->setStyleSheet(actionStyle);
|
||||
connect(plusBtn, &QPushButton::clicked, this, [this] { emit joinRequested(); });
|
||||
fl->addWidget(plusBtn);
|
||||
auto* helpBtn = new QPushButton(QStringLiteral("?"), footer);
|
||||
helpBtn->setObjectName("messageFormattingHelpButton"); helpBtn->setFixedSize(34, 34);
|
||||
helpBtn->setCursor(Qt::PointingHandCursor); helpBtn->setProperty("instantTooltip", true);
|
||||
helpBtn->setToolTip(QCoreApplication::translate("ChatGui", "Message formatting"));
|
||||
helpBtn->setAccessibleName(helpBtn->toolTip()); helpBtn->setStyleSheet(actionStyle + "font-size: 22px; font-weight: bold;");
|
||||
fl->addWidget(helpBtn);
|
||||
connect(helpBtn, &QPushButton::clicked, this, [this] {
|
||||
auto* help = new QMessageBox(QMessageBox::Information, QCoreApplication::translate("ChatGui", "Message formatting"),
|
||||
QCoreApplication::translate("ChatGui",
|
||||
"**text** — bold\n"
|
||||
"__text__ — italic\n"
|
||||
"~~text~~ — strikethrough\n\n"
|
||||
"Use paired tags on one line, without spaces next to the text.\n\n"
|
||||
"Code blocks: put ``` on separate lines, as shown:\n"
|
||||
"```cpp\n"
|
||||
"int value = 42;\n"
|
||||
"```\n\n"
|
||||
"The language after ``` is optional: the chat will try to detect it.\n"
|
||||
"Use ```text to disable highlighting. Copy copies the whole block."), QMessageBox::Ok, this);
|
||||
help->setObjectName("messageFormattingHelp"); help->setAttribute(Qt::WA_DeleteOnClose);
|
||||
help->setTextFormat(Qt::PlainText); help->setTextInteractionFlags(Qt::TextSelectableByMouse); help->open();
|
||||
DEBUG_INFO(DEBUG_CATEGORY_CHAT, "message formatting help opened");
|
||||
});
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_CHAT,
|
||||
"channel actions initialized icons=group-plus/enter icon_px=28 button=40x38 background=transparent tooltip_delay_ms=0");
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_CHAT, "connection monitor button initialized icon=diagnostics icon_px=24 button=34x34 tooltip_delay_ms=0");
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
<TS version="2.1" language="en_US" sourcelanguage="en_US">
|
||||
<context>
|
||||
<name>ChatGui</name>
|
||||
<message><source>Message formatting</source><translation>Message formatting</translation></message>
|
||||
<message>
|
||||
<source>**text** — bold __text__ — italic ~~text~~ — strikethrough Use paired tags on one line, without spaces next to the text. Code blocks: put ``` on separate lines, as shown: ```cpp int value = 42; ``` The language after ``` is optional: the chat will try to detect it. Use ```text to disable highlighting. Copy copies the whole block.</source>
|
||||
<translation>**text** — bold __text__ — italic ~~text~~ — strikethrough Use paired tags on one line, without spaces next to the text. Code blocks: put ``` on separate lines, as shown: ```cpp int value = 42; ``` The language after ``` is optional: the chat will try to detect it. Use ```text to disable highlighting. Copy copies the whole block.</translation>
|
||||
</message>
|
||||
<message><source>Device group name</source><translation>Device group name</translation></message>
|
||||
<message><source>Could not rename device group</source><translation>Could not rename device group</translation></message>
|
||||
<message><source>Expand devices</source><translation>Expand devices</translation></message>
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
<TS version="2.1" language="ru_RU" sourcelanguage="en_US">
|
||||
<context>
|
||||
<name>ChatGui</name>
|
||||
<message><source>Message formatting</source><translation>Форматирование сообщений</translation></message>
|
||||
<message>
|
||||
<source>**text** — bold __text__ — italic ~~text~~ — strikethrough Use paired tags on one line, without spaces next to the text. Code blocks: put ``` on separate lines, as shown: ```cpp int value = 42; ``` The language after ``` is optional: the chat will try to detect it. Use ```text to disable highlighting. Copy copies the whole block.</source>
|
||||
<translation>**текст** — жирный __текст__ — курсив ~~текст~~ — зачёркнутый Ставьте парные теги в одной строке, без пробелов рядом с текстом. Блок кода: ``` должны быть на отдельных строках, как в примере: ```cpp int value = 42; ``` Язык после ``` необязателен: чат попробует определить его сам. Укажите ```text для кода без подсветки. Copy копирует весь блок.</translation>
|
||||
</message>
|
||||
<message><source>Device group name</source><translation>Имя группы устройств</translation></message>
|
||||
<message><source>Could not rename device group</source><translation>Не удалось переименовать группу устройств</translation></message>
|
||||
<message><source>Expand devices</source><translation>Развернуть устройства</translation></message>
|
||||
|
||||
Reference in new issue
Block a user