| 246 | } |
| 247 | |
| 248 | QMenu* Editor::createInsertMenu() |
| 249 | { |
| 250 | QFont ccFont { utils::CONTROL_FONT_FAMILY }; |
| 251 | |
| 252 | QMenu* menu = new QMenu(); |
| 253 | |
| 254 | menu->addAction(utils::fontIcon(utils::LRI_MARK, ccFont), tr("Left-to-Right Isolate"), this, [this]() { insertSurroundingMarks(utils::LRI_MARK, utils::PDI_MARK); }); |
| 255 | menu->addAction(utils::fontIcon(utils::RLI_MARK, ccFont), tr("Right-to-Left Isolate"), this, [this]() { insertSurroundingMarks(utils::RLI_MARK, utils::PDI_MARK); }); |
| 256 | menu->addAction(utils::fontIcon(utils::FSI_MARK, ccFont), tr("First-Strong Isolate"), this, [this]() { insertSurroundingMarks(utils::FSI_MARK, utils::PDI_MARK); }); |
| 257 | |
| 258 | menu->addSeparator(); |
| 259 | |
| 260 | menu->addAction(utils::fontIcon(utils::LRM_MARK, ccFont), tr("Left-to-Right Mark"), this, [this]() { insertMark(utils::LRM_MARK); }); |
| 261 | menu->addAction(utils::fontIcon(utils::RLM_MARK, ccFont), tr("Right-to-Left Mark"), this, [this]() { insertMark(utils::RLM_MARK); }); |
| 262 | menu->addAction(utils::fontIcon(utils::ALM_MARK, ccFont), tr("Arabic Letter Mark"), this, [this]() { insertMark(utils::ALM_MARK); }); |
| 263 | |
| 264 | menu->addSeparator(); |
| 265 | |
| 266 | QAction* insertInlineMathAction = menu->addAction(tr("Inline &Math"), this, [this]() { |
| 267 | insertSurroundingMarks(QStringLiteral("$"), QStringLiteral("$")); |
| 268 | }); |
| 269 | insertInlineMathAction->setIcon(utils::fontIcon(QChar(0x221a))); |
| 270 | insertInlineMathAction->setShortcut(Qt::CTRL | Qt::Key_M); |
| 271 | |
| 272 | QAction* insertColorAction = menu->addAction(tr("&Color..."), this, &Editor::showColorPicker); |
| 273 | insertColorAction->setShortcut(INSERT_COLOR); |
| 274 | |
| 275 | menu->addAction(tr("&Symbol..."), this, &Editor::showSymbolPicker); |
| 276 | |
| 277 | return menu; |
| 278 | } |
| 279 | |
| 280 | QTextCursor Editor::cursorAt(int blockNum, int charOffset) const |
| 281 | { |
no test coverage detected