diff --git a/cmainwindow.cpp b/cmainwindow.cpp index d681079..911e487 100644 --- a/cmainwindow.cpp +++ b/cmainwindow.cpp @@ -68,6 +68,7 @@ cMainWindow::cMainWindow(cSplashScreen *lpSplashScreen, QTranslator *lpTranslato m_lpEditToolBar(0), m_lpTextToolBar(0), m_lpFormatToolBar(0), + m_lpViewToolBar(0), m_lpOldTextEdit(0), m_lpOptionsDialog(0) { @@ -438,6 +439,10 @@ void cMainWindow::createTextActions() m_lpComboSize->addItem(QString::number(size)); m_lpComboSize->setCurrentIndex(standardSizes.indexOf(QApplication::font().pointSize())); m_focusException.append(m_lpComboSize); + + m_lpViewToolBar = addToolBar(tr("Format Actions")); + m_lpViewToolBar->setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea); + addToolBar(m_lpViewToolBar); } void cMainWindow::createToolsActions() @@ -609,14 +614,14 @@ void cMainWindow::prepareTextEdit(cTextEdit* lpTextEdit) connect(m_lpPasteAction, &QAction::triggered, lpTextEdit, &cTextEdit::paste); #endif - connect(m_lpAlignGroup, &QActionGroup::triggered, lpTextEdit, &cTextEdit::onTextAlign); + connect(m_lpAlignGroup, &QActionGroup::triggered, lpTextEdit, &cTextEdit::onTextAlign); connect(m_lpComboFont, QOverload::of(&QComboBox::activated), lpTextEdit, &cTextEdit::onTextFamily); connect(m_lpComboSize, QOverload::of(&QComboBox::activated), lpTextEdit, &cTextEdit::onTextSize); - connect(lpTextEdit, &cTextEdit::fontChanged, this, &cMainWindow::onFontChanged); - connect(lpTextEdit, &cTextEdit::colorChanged, this, &cMainWindow::onColorChanged); - connect(lpTextEdit, &cTextEdit::alignmentChanged, this, &cMainWindow::onAlignmentChanged); + connect(lpTextEdit, &cTextEdit::fontChanged, this, &cMainWindow::onFontChanged); + connect(lpTextEdit, &cTextEdit::colorChanged, this, &cMainWindow::onColorChanged); + connect(lpTextEdit, &cTextEdit::alignmentChanged, this, &cMainWindow::onAlignmentChanged); m_lpOldTextEdit = lpTextEdit; } @@ -650,9 +655,9 @@ void cMainWindow::disconnectTextEdit() disconnect(m_lpComboFont, QOverload::of(&QComboBox::activated), m_lpOldTextEdit, &cTextEdit::onTextFamily); disconnect(m_lpComboSize, QOverload::of(&QComboBox::activated), m_lpOldTextEdit, &cTextEdit::onTextSize); - disconnect(m_lpOldTextEdit, &cTextEdit::fontChanged, this, &cMainWindow::onFontChanged); - disconnect(m_lpOldTextEdit, &cTextEdit::colorChanged, this, &cMainWindow::onColorChanged); - disconnect(m_lpOldTextEdit, &cTextEdit::alignmentChanged, this, &cMainWindow::onAlignmentChanged); + disconnect(m_lpOldTextEdit, &cTextEdit::fontChanged, this, &cMainWindow::onFontChanged); + disconnect(m_lpOldTextEdit, &cTextEdit::colorChanged, this, &cMainWindow::onColorChanged); + disconnect(m_lpOldTextEdit, &cTextEdit::alignmentChanged, this, &cMainWindow::onAlignmentChanged); } } diff --git a/cmainwindow.h b/cmainwindow.h index 40f4584..ad12792 100644 --- a/cmainwindow.h +++ b/cmainwindow.h @@ -694,6 +694,7 @@ private: QToolBar* m_lpEditToolBar; /*!< Pointer to the edit toolbar */ QToolBar* m_lpTextToolBar; /*!< Pointer to the text toolbar */ QToolBar* m_lpFormatToolBar; /*!< Pointer to the text format toolbar*/ + QToolBar* m_lpViewToolBar; /*!< Pointer to the text view toolbar*/ QAction* m_lpFileNewAction; /*!< TODO: describe */ QAction* m_lpFileOpenAction; /*!< TODO: describe */