Commit 0e5aa550 authored by Laurent Montel's avatar Laurent Montel 😁

Start to reimplement bold support

parent 222aaa69
......@@ -157,6 +157,7 @@ private:
Q_PRIVATE_SLOT(d, void _k_slotPasteWithoutFormatting())
Q_PRIVATE_SLOT(d, void _k_slotInsertSpecialChar())
Q_PRIVATE_SLOT(d, void _k_slotInsertAnchor())
Q_PRIVATE_SLOT(d, void _k_slotBold(bool))
};
}
#endif // COMPOSERWEBENGINE_H
......@@ -130,6 +130,7 @@ void ComposerEditorWebEnginePrivate::createAction(ComposerWebEngine::ComposerWeb
action_text_bold->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_B));
//FORWARD_ACTION(action_text_bold, QWebPage::ToggleBold);
htmlEditorActionList.append(action_text_bold);
q->connect(action_text_bold, SIGNAL(triggered(bool)), SLOT(_k_slotBold(bool)));
}
break;
}
......@@ -677,7 +678,8 @@ void ComposerEditorWebEnginePrivate::_k_slotInsertTable()
void ComposerEditorWebEnginePrivate::_k_slotInsertHorizontalRule()
{
execCommand(QStringLiteral("insertHTML"), QStringLiteral("<hr>"));
execCommand(QStringLiteral("insertHorizontalRule"));
}
void ComposerEditorWebEnginePrivate::_k_insertLink()
......@@ -711,6 +713,11 @@ void ComposerEditorWebEnginePrivate::_k_slotOpenLink()
#endif
}
void ComposerEditorWebEnginePrivate::_k_slotBold(bool b)
{
execCommand(QStringLiteral("bold"), b ? QStringLiteral("true") : QStringLiteral("false"));
}
void ComposerEditorWebEnginePrivate::_k_setFontSize(int fontSize)
{
execCommand(QStringLiteral("fontSize"), QString::number(fontSize + 1)); //Verify
......
......@@ -91,6 +91,7 @@ public:
void _k_slotInsertSpecialChar();
void _k_slotInsertAnchor();
void _k_slotOpenLink();
void _k_slotBold(bool);
QAction *getAction(QWebEnginePage::WebAction action) const;
QVariant evaluateJavascript(const QString &command);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment