diff --git a/limereport/items/lrimageitem.cpp b/limereport/items/lrimageitem.cpp index 72f5a62..a271cda 100644 --- a/limereport/items/lrimageitem.cpp +++ b/limereport/items/lrimageitem.cpp @@ -31,6 +31,7 @@ #include "lrdesignelementsfactory.h" #include "lrglobal.h" #include "lrdatasourcemanager.h" +#include "lrpagedesignintf.h" namespace{ @@ -76,6 +77,20 @@ void ImageItem::loadPictureFromVariant(QVariant& data){ } } +void ImageItem::preparePopUpMenu(QMenu &menu) +{ + QAction* action = menu.addAction(tr("Watermark")); + action->setCheckable(true); + action->setChecked(isWatermark()); +} + +void ImageItem::processPopUpAction(QAction *action) +{ + if (action->text().compare(tr("Watermark")) == 0){ + page()->setPropertyToSelectedItems("watermark",action->isChecked()); + } +} + void ImageItem::updateItemSize(DataSourceManager* dataManager, RenderPass pass, int maxHeight) { diff --git a/limereport/items/lrimageitem.h b/limereport/items/lrimageitem.h index 4c16699..f6713df 100644 --- a/limereport/items/lrimageitem.h +++ b/limereport/items/lrimageitem.h @@ -87,6 +87,8 @@ protected: bool isNeedUpdateSize(RenderPass) const; bool drawDesignBorders() const {return m_picture.isNull();} void loadPictureFromVariant(QVariant& data); + void preparePopUpMenu(QMenu &menu); + void processPopUpAction(QAction *action); private: QImage m_picture; QString m_resourcePath; diff --git a/limereport/items/lrtextitem.cpp b/limereport/items/lrtextitem.cpp index 772f084..47318dc 100644 --- a/limereport/items/lrtextitem.cpp +++ b/limereport/items/lrtextitem.cpp @@ -111,6 +111,9 @@ void TextItem::preparePopUpMenu(QMenu &menu) action->setCheckable(true); action->setChecked(backgroundMode() == TransparentMode); + action = menu.addAction(tr("Watermark")); + action->setCheckable(true); + action->setChecked(isWatermark()); } void TextItem::processPopUpAction(QAction *action) @@ -137,6 +140,9 @@ void TextItem::processPopUpAction(QAction *action) setProperty("backgroundMode",OpaqueMode); } } + if (action->text().compare(tr("Watermark")) == 0){ + page()->setPropertyToSelectedItems("watermark",action->isChecked()); + } } void TextItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* style, QWidget* widget) {