|
@@ -195,7 +195,7 @@ void MainWindow::createActions()
|
|
tool->addAction(act);
|
|
tool->addAction(act);
|
|
|
|
|
|
icon = QIcon::fromTheme("document-save-as");
|
|
icon = QIcon::fromTheme("document-save-as");
|
|
- act = new QAction(tr("Save &As..."), this);
|
|
|
|
|
|
+ act = new QAction(icon, tr("Save &As..."), this);
|
|
act->setShortcuts(QKeySequence::SaveAs);
|
|
act->setShortcuts(QKeySequence::SaveAs);
|
|
act->setStatusTip(tr("Save the document under a new name"));
|
|
act->setStatusTip(tr("Save the document under a new name"));
|
|
connect(act, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
|
|
connect(act, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
|
|
@@ -272,26 +272,37 @@ void MainWindow::createActions()
|
|
icon = QIcon::fromTheme("format-text-bold", QIcon(":/images/textbold.png"));
|
|
icon = QIcon::fromTheme("format-text-bold", QIcon(":/images/textbold.png"));
|
|
actionTextBold = act = new QAction(icon, tr("Bold"), this);
|
|
actionTextBold = act = new QAction(icon, tr("Bold"), this);
|
|
act->setShortcuts(QKeySequence::Bold);
|
|
act->setShortcuts(QKeySequence::Bold);
|
|
|
|
+ act->setCheckable(true);
|
|
|
|
+ connect(act, SIGNAL(triggered()), this, SLOT(textBold()));
|
|
menu->addAction(act);
|
|
menu->addAction(act);
|
|
tool->addAction(act);
|
|
tool->addAction(act);
|
|
|
|
|
|
icon = QIcon::fromTheme("format-text-italic", QIcon(":/images/textitalic.png"));
|
|
icon = QIcon::fromTheme("format-text-italic", QIcon(":/images/textitalic.png"));
|
|
- actionTextBold = act = new QAction(icon, tr("Italic"), this);
|
|
|
|
|
|
+ actionTextItalic = act = new QAction(icon, tr("Italic"), this);
|
|
act->setShortcuts(QKeySequence::Italic);
|
|
act->setShortcuts(QKeySequence::Italic);
|
|
|
|
+ act->setCheckable(true);
|
|
|
|
+ connect(act, SIGNAL(triggered()), this, SLOT(textItalic()));
|
|
menu->addAction(act);
|
|
menu->addAction(act);
|
|
tool->addAction(act);
|
|
tool->addAction(act);
|
|
|
|
|
|
icon = QIcon::fromTheme("format-text-underline", QIcon(":/images/textunderline.png"));
|
|
icon = QIcon::fromTheme("format-text-underline", QIcon(":/images/textunderline.png"));
|
|
- actionTextBold = act = new QAction(icon, tr("Underline"), this);
|
|
|
|
|
|
+ actionTextUnder = act = new QAction(icon, tr("Underline"), this);
|
|
act->setShortcuts(QKeySequence::Underline);
|
|
act->setShortcuts(QKeySequence::Underline);
|
|
|
|
+ act->setCheckable(true);
|
|
|
|
+ connect(act, SIGNAL(triggered()), this, SLOT(textUnder()));
|
|
menu->addAction(act);
|
|
menu->addAction(act);
|
|
tool->addAction(act);
|
|
tool->addAction(act);
|
|
|
|
|
|
icon = QIcon::fromTheme("format-text-strikethrough", QIcon(":/images/textstrike.png"));
|
|
icon = QIcon::fromTheme("format-text-strikethrough", QIcon(":/images/textstrike.png"));
|
|
actionTextStrike = act = new QAction(icon, tr("Strikethrough"), this);
|
|
actionTextStrike = act = new QAction(icon, tr("Strikethrough"), this);
|
|
|
|
+ act->setCheckable(true);
|
|
|
|
+ connect(act, SIGNAL(triggered()), this, SLOT(textStrike()));
|
|
menu->addAction(act);
|
|
menu->addAction(act);
|
|
tool->addAction(act);
|
|
tool->addAction(act);
|
|
|
|
|
|
|
|
+ // format-text-subscript
|
|
|
|
+ // format-text-superscript
|
|
|
|
+
|
|
menu = menuBar()->addMenu(tr("&View"));
|
|
menu = menuBar()->addMenu(tr("&View"));
|
|
|
|
|
|
QAction * actText = act = new QAction(tr("&Text"), this);
|
|
QAction * actText = act = new QAction(tr("&Text"), this);
|
|
@@ -559,6 +570,13 @@ void MainWindow::textItalic()
|
|
mergeFormatOnWordOrSelection(fmt);
|
|
mergeFormatOnWordOrSelection(fmt);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void MainWindow::textStrike()
|
|
|
|
+{
|
|
|
|
+ QTextCharFormat fmt;
|
|
|
|
+ fmt.setFontStrikeOut(actionTextStrike->isChecked());
|
|
|
|
+ mergeFormatOnWordOrSelection(fmt);
|
|
|
|
+}
|
|
|
|
+
|
|
void MainWindow::mergeFormatOnWordOrSelection(const QTextCharFormat &format)
|
|
void MainWindow::mergeFormatOnWordOrSelection(const QTextCharFormat &format)
|
|
{
|
|
{
|
|
if (!textEdit) return;
|
|
if (!textEdit) return;
|