diff --git a/libs/widgets/CMakeLists.txt b/libs/widgets/CMakeLists.txt --- a/libs/widgets/CMakeLists.txt +++ b/libs/widgets/CMakeLists.txt @@ -181,6 +181,7 @@ KoLineStyleSelector.h KoDockWidgetTitleBar.h KoDockWidgetTitleBarButton.h + KoModeBox.h KoResourceModelBase.h diff --git a/libs/widgets/KoModeBox.cpp b/libs/widgets/KoModeBox.cpp --- a/libs/widgets/KoModeBox.cpp +++ b/libs/widgets/KoModeBox.cpp @@ -22,7 +22,7 @@ #include -#include "KoModeBox_p.h" +#include "KoModeBox.h" #include #include @@ -71,7 +71,7 @@ } KoCanvasBase *canvas; - QGridLayout *layout; + QVBoxLayout *layout; QList toolActions; // toolActions maintained by toolmanager QList addedToolActions; //tools in the order added to QToolBox QMap addedWidgets; @@ -128,19 +128,15 @@ d->verticalTabsSide = (VerticalTabsSide)cfg.readEntry("ModeBoxVerticalTabsSide", (int)TopSide); d->horizontalTabsSide = (HorizontalTabsSide)cfg.readEntry("ModeBoxHorizontalTabsSide", (int)LeftSide); - d->layout = new QGridLayout(); + d->layout = new QVBoxLayout(); d->stack = new QStackedWidget(); d->tabBar = new QTabBar(); - setIconSize(); - d->tabBar->setExpanding(d->horizontalMode); - if (d->horizontalMode) { - switchTabsSide(d->verticalTabsSide); - } else { - switchTabsSide(d->horizontalTabsSide); - } + d->tabBar->setIconSize(QSize(22,22)); + d->tabBar->setExpanding(true); d->tabBar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); - d->layout->addWidget(d->stack, 0, 1); + d->layout->addWidget(d->tabBar, 0); + d->layout->addWidget(d->stack, 1); d->layout->setContentsMargins(0,0,0,0); setLayout(d->layout); @@ -183,37 +179,7 @@ void KoModeBox::locationChanged(Qt::DockWidgetArea area) { - resize(0,0); - switch(area) { - case Qt::TopDockWidgetArea: - case Qt::BottomDockWidgetArea: - d->horizontalMode = true; - d->layout->removeWidget(d->stack); - d->layout->addWidget(d->stack, 1, 0); - d->layout->setColumnStretch(1, 0); - d->layout->setRowStretch(1, 100); - break; - case Qt::LeftDockWidgetArea: - case Qt::RightDockWidgetArea: - d->horizontalMode = false; - d->layout->removeWidget(d->stack); - d->layout->addWidget(d->stack, 0, 1); - d->layout->setColumnStretch(1, 100); - d->layout->setRowStretch(1, 0); - break; - default: - break; - } - d->layout->setSizeConstraint(QLayout::SetMinAndMaxSize); - d->layout->invalidate(); - - setIconSize(); - d->tabBar->setExpanding(d->horizontalMode); - if (d->horizontalMode) { - switchTabsSide(d->verticalTabsSide); - } else { - switchTabsSide(d->horizontalTabsSide); - } + // TODO } void KoModeBox::setActiveTool(KoCanvasController *canvas, int id) @@ -301,30 +267,6 @@ return QIcon(QPixmap::fromImage(pm)); } -QIcon KoModeBox::createSimpleIcon(KoToolAction *toolAction) const -{ - QSize iconSize = d->tabBar->iconSize(); - - // This must be a QImage, as drawing to a QPixmap outside the - // UI thread will cause sporadic crashes. - QImage pm(iconSize, QImage::Format_ARGB32_Premultiplied); - pm.fill(Qt::transparent); - QPainter p(&pm); - if (!d->horizontalMode) { - if (d->horizontalTabsSide == LeftSide ) { - p.rotate(90); - p.translate(0,-iconSize.width()); - } else { - p.rotate(-90); - p.translate(-iconSize.height(),0); - } - } - - QIcon::fromTheme(toolAction->iconName()).paint(&p, 0, 0, iconSize.height(), iconSize.width()); - - return QIcon(QPixmap::fromImage(pm)); -} - void KoModeBox::addItem(KoToolAction *toolAction) { QWidget *oldwidget = d->addedWidgets[toolAction->buttonGroupId()]; @@ -345,25 +287,12 @@ d->addedWidgets[toolAction->buttonGroupId()] = widget; // Create a rotated icon with text - if (d->iconMode == IconAndText) { - if (d->horizontalMode) { - d->tabBar->addTab(QIcon::fromTheme(toolAction->iconName()), toolAction->iconText()); - } else { - d->tabBar->addTab(createTextIcon(toolAction), QString()); - } - } else { - int index = d->tabBar->addTab(createSimpleIcon(toolAction), QString()); - d->tabBar->setTabToolTip(index, toolAction->toolTip()); - } + int index = d->tabBar->addTab(QIcon::fromTheme(toolAction->iconName()), QString()); + d->tabBar->setTabToolTip(index, toolAction->iconText()); d->tabBar->blockSignals(false); ScrollArea *sa = new ScrollArea(); - if (d->horizontalMode) { - sa->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); - sa->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - } else { - sa->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - sa->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); - } + sa->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + sa->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); sa->setWidgetResizable(true); sa->setContentsMargins(0,0,0,0); sa->setWidget(widget); @@ -459,66 +388,40 @@ layout->setRowStretch(1, 0); layout->setRowStretch(2, 0); - if (d->horizontalMode) { - layout->setRowStretch(0, 1); - layout->setRowStretch(1, 2); - layout->setRowStretch(2, 1); - layout->setHorizontalSpacing(2); - layout->setVerticalSpacing(0); - foreach(QWidget *widget, optionWidgetList) { - if (!widget->windowTitle().isEmpty()) { - QLabel *l; - layout->addWidget(l = new QLabel(widget->windowTitle()), 0, cnt, 1, 1, Qt::AlignLeft); - d->currentAuxWidgets.insert(l); - } - layout->addWidget(widget, 1, cnt++, 2, 1); - widget->show(); - if (widget != optionWidgetList.last()) { - QFrame *s; - layout->addWidget(s = new QFrame(), 1, cnt, 1, 1, Qt::AlignHCenter); - layout->setColumnMinimumWidth(cnt++, 16); - s->setFrameStyle(QFrame::VLine | QFrame::Sunken); - d->currentAuxWidgets.insert(s); - ++cnt; - } - layout->setColumnStretch(cnt, 100); + layout->setColumnStretch(0, 1); + layout->setColumnStretch(1, 2); + layout->setColumnStretch(2, 1); + layout->setHorizontalSpacing(0); + layout->setVerticalSpacing(2); + int specialCount = 0; + foreach(QWidget *widget, optionWidgetList) { + if (!widget->windowTitle().isEmpty()) { + QLabel *l; + layout->addWidget(l = new QLabel(widget->windowTitle()), cnt++, 0, 1, 3, Qt::AlignHCenter); + d->currentAuxWidgets.insert(l); } - } else { - layout->setColumnStretch(0, 1); - layout->setColumnStretch(1, 2); - layout->setColumnStretch(2, 1); - layout->setHorizontalSpacing(0); - layout->setVerticalSpacing(2); - int specialCount = 0; - foreach(QWidget *widget, optionWidgetList) { - if (!widget->windowTitle().isEmpty()) { - QLabel *l; - layout->addWidget(l = new QLabel(widget->windowTitle()), cnt++, 0, 1, 3, Qt::AlignHCenter); - d->currentAuxWidgets.insert(l); - } - layout->addWidget(widget, cnt++, 0, 1, 3); - QLayout *subLayout = widget->layout(); - if (subLayout) { - for (int i = 0; i < subLayout->count(); ++i) { - QWidget *spacerWidget = subLayout->itemAt(i)->widget(); - if (spacerWidget && spacerWidget->objectName().contains("SpecialSpacer")) { - specialCount++; - } + layout->addWidget(widget, cnt++, 0, 1, 3); + QLayout *subLayout = widget->layout(); + if (subLayout) { + for (int i = 0; i < subLayout->count(); ++i) { + QWidget *spacerWidget = subLayout->itemAt(i)->widget(); + if (spacerWidget && spacerWidget->objectName().contains("SpecialSpacer")) { + specialCount++; } } - widget->show(); - if (widget != optionWidgetList.last()) { - QFrame *s; - layout->addWidget(s = new QFrame(), cnt, 1, 1, 1); - layout->setRowMinimumHeight(cnt++, 16); - s->setFrameStyle(QFrame::HLine | QFrame::Sunken); - d->currentAuxWidgets.insert(s); - } } - if (specialCount == optionWidgetList.count()) { - layout->setRowStretch(cnt, 100); + widget->show(); + if (widget != optionWidgetList.last()) { + QFrame *s; + layout->addWidget(s = new QFrame(), cnt, 1, 1, 1); + layout->setRowMinimumHeight(cnt++, 16); + s->setFrameStyle(QFrame::HLine | QFrame::Sunken); + d->currentAuxWidgets.insert(s); } } + if (specialCount == optionWidgetList.count()) { + layout->setRowStretch(cnt, 100); + } } void ScrollArea::showEvent(QShowEvent *e) @@ -579,17 +482,16 @@ } } -void KoModeBox::slotContextMenuRequested(const QPoint &pos) -{ +void KoModeBox::slotContextMenuRequested(const QPoint &pos) { QMenu menu; - KSelectAction* textAction = new KSelectAction(i18n("Text"), &menu); + KSelectAction *textAction = new KSelectAction(i18n("Text"), &menu); connect(textAction, SIGNAL(triggered(int)), SLOT(switchIconMode(int))); menu.addAction(textAction); textAction->addAction(i18n("Icon and Text")); textAction->addAction(i18n("Icon only")); textAction->setCurrentItem(d->iconMode); - KSelectAction* buttonPositionAction = new KSelectAction(i18n("Tabs side"), &menu); + KSelectAction *buttonPositionAction = new KSelectAction(i18n("Tabs side"), &menu); connect(buttonPositionAction, SIGNAL(triggered(int)), SLOT(switchTabsSide(int))); menu.addAction(buttonPositionAction); if (d->horizontalMode) { @@ -605,55 +507,3 @@ menu.exec(d->tabBar->mapToGlobal(pos)); } -void KoModeBox::switchIconMode(int mode) -{ - d->iconMode = static_cast(mode); - setIconSize(); - updateShownTools(QList()); - - KConfigGroup cfg = KSharedConfig::openConfig()->group("calligra"); - cfg.writeEntry("ModeBoxIconMode", (int)d->iconMode); - -} - -void KoModeBox::switchTabsSide(int side) -{ - if (d->horizontalMode) { - d->verticalTabsSide = static_cast(side); - if (d->verticalTabsSide == TopSide) { - d->layout->removeWidget(d->tabBar); - d->tabBar->setShape(QTabBar::RoundedNorth); - d->layout->addWidget(d->tabBar, 0, 0); - } else { - d->layout->removeWidget(d->tabBar); - d->tabBar->setShape(QTabBar::RoundedSouth); - d->layout->addWidget(d->tabBar, 2, 0); - } - - KConfigGroup cfg = KSharedConfig::openConfig()->group("calligra"); - cfg.writeEntry("ModeBoxVerticalTabsSide", (int)d->verticalTabsSide); - } else { - d->horizontalTabsSide = static_cast(side); - if (d->horizontalTabsSide == LeftSide) { - d->layout->removeWidget(d->tabBar); - d->tabBar->setShape(QTabBar::RoundedWest); - d->layout->addWidget(d->tabBar, 0, 0); - } else { - d->layout->removeWidget(d->tabBar); - d->tabBar->setShape(QTabBar::RoundedEast); - d->layout->addWidget(d->tabBar, 0, 2); - } - - KConfigGroup cfg = KSharedConfig::openConfig()->group("calligra"); - cfg.writeEntry("ModeBoxHorizontalTabsSide", (int)d->horizontalTabsSide); - } - updateShownTools(QList()); -} - -void KoModeBox::setIconSize() const { - if (!d->horizontalMode && d->iconMode == IconAndText) { - d->tabBar->setIconSize(QSize(32,64)); - } else { - d->tabBar->setIconSize(QSize(22,22)); - } -} diff --git a/libs/widgets/KoModeBoxDocker.cpp b/libs/widgets/KoModeBoxDocker.cpp --- a/libs/widgets/KoModeBoxDocker.cpp +++ b/libs/widgets/KoModeBoxDocker.cpp @@ -20,7 +20,7 @@ */ #include "KoModeBoxDocker_p.h" -#include "KoModeBox_p.h" +#include "KoModeBox.h" #include #include @@ -30,11 +30,11 @@ : m_modeBox(modeBox) { setWidget(modeBox); - setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable); + setFeatures(QDockWidget::NoDockWidgetFeatures); setWindowTitle(""); setObjectName("ModeBox"); - connect(this, SIGNAL(dockLocationChanged(Qt::DockWidgetArea)), this, SLOT(locationChanged(Qt::DockWidgetArea))); + connect(this, &KoModeBoxDocker::dockLocationChanged, this, &KoModeBoxDocker::locationChanged); } void KoModeBoxDocker::setCanvas(KoCanvasBase *canvas) diff --git a/libs/widgets/KoModeBoxFactory.cpp b/libs/widgets/KoModeBoxFactory.cpp --- a/libs/widgets/KoModeBoxFactory.cpp +++ b/libs/widgets/KoModeBoxFactory.cpp @@ -20,7 +20,7 @@ #include "KoModeBoxFactory.h" #include -#include "KoModeBox_p.h" +#include "KoModeBox.h" #include "KoModeBoxDocker_p.h" class Q_DECL_HIDDEN KoModeBoxFactory::Private @@ -49,13 +49,14 @@ KoDockFactoryBase::DockPosition KoModeBoxFactory::defaultDockPosition() const { - return KoDockFactoryBase::DockRight; + return KoDockFactoryBase::DockLeft; } QDockWidget* KoModeBoxFactory::createDockWidget() { KoModeBox *box = new KoModeBox(d->canvasController, d->applicationName); QDockWidget *docker = new KoModeBoxDocker(box); + docker->setTitleBarWidget(new QWidget()); return docker; } diff --git a/libs/widgets/KoModeBox_p.h b/libs/widgets/KoModeBox_p.h deleted file mode 100644 --- a/libs/widgets/KoModeBox_p.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2005 Boudewijn Rempt - * Copyright (c) 2005-2008 Thomas Zander - * Copyright (c) 2009 Peter Simonsson - * Copyright (c) 2010 Cyrille Berger - * Copyright (c) 2011 C. Boemann - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -#ifndef KO_MODEBOX_H -#define KO_MODEBOX_H - -#include - -#include -#include -#include -#include -#include -#include - -#include - -class KoCanvasControllerWidget; -class KoCanvasController; -class KoCanvasBase; -class KoShapeLayer; - -class ScrollArea : public QScrollArea -{ - Q_OBJECT -protected: - void showEvent(QShowEvent *) override; -}; - -/** - * KoModeBox is housed in a dock widget that presents tools as headings in a QToolBox - * according to type and priority. - * - * The ModeBox is a container for tool buttons which are themselves - * divided into sections. - * - * @see KoToolManager - */ -class KoModeBox : public QWidget { - Q_OBJECT -public: - /// constructor - explicit KoModeBox(KoCanvasControllerWidget *canvas, const QString &applicationName); - ~KoModeBox() override; - - /** - * Should been called when the docker position has changed. - * Organise widgets and icons and orientation of the tabs. - * - * @param area the new location area - */ - void locationChanged(Qt::DockWidgetArea area); -public Q_SLOTS: - /** - * Using the buttongroup id passed in addButton() you can set the new active tool. - * If the id does not resolve to a visible heading, this call is ignored. - * @param canvas the currently active canvas. - * @param id an id to identify the tool/heading to activate. - */ - void setActiveTool(KoCanvasController *canvas, int id); - - /** - * Show only the dynamic buttons that have a code from parameter codes. - * The modebox allows buttons to be optionally registered with a visibilityCode. This code - * can be passed here and all buttons that have that code are shown. All buttons that - * have another visibility code registered are hidden. - * @param codes a list of all the codes to show. - */ - void updateShownTools(const QList &codes); - - void setOptionWidgets(const QList > &optionWidgetList); - - /// set the canvas this docker should listen to for changes. - void setCanvas(KoCanvasBase *canvas); - void unsetCanvas(); - -private Q_SLOTS: - void setCurrentLayer(const KoCanvasController *canvas, const KoShapeLayer* newLayer); - - /// add a tool post-initialization. The tool will also be activated. - void toolAdded(KoToolAction *toolAction, KoCanvasController *canvas); - - /// slot for when a new item have been selected in the QToolBox - void toolSelected(int index); - - /// slot for context menu of the tabbar - void slotContextMenuRequested(const QPoint &pos); - - /// switch icon mode - void switchIconMode(int); - - /// switch tabs side - void switchTabsSide(int); - - /** - * Add a tool to the modebox. - * The tools should all be added before the first showing since adding will not really add - * them to the UI until setup() is called. - * - * @param toolAction the action of the tool - * @see setup() - */ - void addToolAction(KoToolAction *toolAction); - -public: - static QString applicationName; - -private: - enum IconMode { - IconAndText, - IconOnly - }; - - enum VerticalTabsSide { - TopSide, - BottomSide - }; - - enum HorizontalTabsSide { - LeftSide, - RightSide - }; - - QIcon createTextIcon(KoToolAction *toolAction) const; - QIcon createSimpleIcon(KoToolAction *toolAction) const; - void addItem(KoToolAction *toolAction); - void setIconSize() const; - -private: - class Private; - Private * const d; -}; - -#endif // _KO_TOOLBOX_H_ diff --git a/plugins/textshape/TextTool.h b/plugins/textshape/TextTool.h --- a/plugins/textshape/TextTool.h +++ b/plugins/textshape/TextTool.h @@ -41,6 +41,7 @@ #include #include #include +#include #include @@ -371,6 +372,8 @@ QAction *m_actionFormatSub; QAction *m_actionFormatIncreaseIndent; QAction *m_actionFormatDecreaseIndent; + QAction *m_actionIncreaseFontSize; + QAction *m_actionDecreaseFontSize; QAction *m_autoResizeAction; QAction *m_growWidthAction; QAction *m_growHeightAction; diff --git a/plugins/textshape/TextTool.cpp b/plugins/textshape/TextTool.cpp --- a/plugins/textshape/TextTool.cpp +++ b/plugins/textshape/TextTool.cpp @@ -109,6 +109,8 @@ #include #include +#include + class TextToolSelection : public KoToolSelection { @@ -301,6 +303,16 @@ m_actionFormatSub->setCheckable(true); connect(m_actionFormatSub, SIGNAL(triggered(bool)), this, SLOT(subScript(bool))); + m_actionDecreaseFontSize = new QAction(QIcon::fromTheme(QStringLiteral("format-font-size-less")), i18n("Decrease Font Size"), this); + addAction(QStringLiteral("format_decrease_font_size"), m_actionDecreaseFontSize); + m_actionFormatSub->setCheckable(true); + //connect(m_actionDecreaseFontSize, &QActiontriggered, this, &TextTool::decreaseFontSize); + + m_actionIncreaseFontSize = new QAction(QIcon::fromTheme(QStringLiteral("format-font-size-more")), i18n("Increase Font Size"), this); + addAction(QStringLiteral("format_increase_font_size"), m_actionIncreaseFontSize); + m_actionFormatSub->setCheckable(true); + //connect(m_actionIncreaseFontSize, &QAction::triggered, this, &TextTool::decreaseFontSize); + const char* const increaseIndentActionIconName = QApplication::isRightToLeft() ? koIconNameCStr("format-indent-less") : koIconNameCStr("format-indent-more"); m_actionFormatIncreaseIndent = new QAction( diff --git a/plugins/textshape/TextToolFactory.cpp b/plugins/textshape/TextToolFactory.cpp --- a/plugins/textshape/TextToolFactory.cpp +++ b/plugins/textshape/TextToolFactory.cpp @@ -30,7 +30,7 @@ { setToolTip(i18n("Text editing")); setToolType(dynamicToolType()+",calligrawords,calligraauthor"); - setIconName(koIconName("tool-text")); + setIconName(koIconName("dialog-text-and-font")); setPriority(1); setActivationShapeId(TextShape_SHAPEID "," AnnotationShape_SHAPEID); } diff --git a/plugins/textshape/dialogs/SimpleCharacterWidget.cpp b/plugins/textshape/dialogs/SimpleCharacterWidget.cpp --- a/plugins/textshape/dialogs/SimpleCharacterWidget.cpp +++ b/plugins/textshape/dialogs/SimpleCharacterWidget.cpp @@ -42,6 +42,7 @@ #include #include + SimpleCharacterWidget::SimpleCharacterWidget(TextTool *tool, QWidget *parent) : QWidget(parent), m_styleManager(0), @@ -62,6 +63,8 @@ widget.backgroundColor->setDefaultAction(tool->action("format_backgroundcolor")); widget.superscript->setDefaultAction(tool->action("format_super")); widget.subscript->setDefaultAction(tool->action("format_sub")); + // widget.decreaseFont->setDefaultAction(tool->action("format_decrease_font_size")); + widget.increaseFont->setDefaultAction(tool->action("format-increase_font_size")); widget.moreOptions->setText("..."); widget.moreOptions->setToolTip(i18n("Change font format")); connect(widget.moreOptions, SIGNAL(clicked(bool)), tool->action("format_font"), SLOT(trigger())); diff --git a/plugins/textshape/dialogs/SimpleCharacterWidget.ui b/plugins/textshape/dialogs/SimpleCharacterWidget.ui --- a/plugins/textshape/dialogs/SimpleCharacterWidget.ui +++ b/plugins/textshape/dialogs/SimpleCharacterWidget.ui @@ -33,113 +33,108 @@ 0 - + + + + + + 2 + + + 0 + + + + + 2 - - - - 2 - - - 0 - - - - - - - true - - - - - - - true - - - - - - - true - - - - - - - true - - - - - - - true - - - - - - - true - - - - - - - true - - - - - - - true - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 0 - 13 - - - - - - - - - - - ... - - - + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + - - - - 0 - 0 - + + + 2 - + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + ... + + + + diff --git a/words/part/KWGui.h b/words/part/KWGui.h --- a/words/part/KWGui.h +++ b/words/part/KWGui.h @@ -22,11 +22,13 @@ #include +#include class KWView; class KWCanvas; class KoCanvasController; class KoRuler; +class KoModeBox; class QMouseEvent; diff --git a/words/part/KWGui.cpp b/words/part/KWGui.cpp --- a/words/part/KWGui.cpp +++ b/words/part/KWGui.cpp @@ -43,6 +43,7 @@ #include #include #include +#include KWGui::KWGui(const QString &viewMode, KWView *parent) : QWidget(parent), diff --git a/words/part/KWView.cpp b/words/part/KWView.cpp --- a/words/part/KWView.cpp +++ b/words/part/KWView.cpp @@ -294,6 +294,12 @@ action = actionCollection()->addAction(KStandardAction::Paste, "edit_paste", 0, 0); new KoPasteController(canvasBase(), action); + action = new QAction(QIcon::fromTheme(QStringLiteral("shapes")), i18n("Add shapes"), this); + connect(action, &QAction::triggered, this, []() { + qDebug() << "clicked add shapes"; + }); + actionCollection()->addAction("edit_add-shape", action); + action = new QAction(koIcon("edit-delete"), i18n("Delete"), this); action->setShortcut(QKeySequence("Del")); connect(action, SIGNAL(triggered()), this, SLOT(editDeleteSelection())); diff --git a/words/part/calligrawords.rc b/words/part/calligrawords.rc --- a/words/part/calligrawords.rc +++ b/words/part/calligrawords.rc @@ -97,13 +97,15 @@ - + + +