mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-24 16:44:39 +03:00
Watermark property can be changed by context menu
This commit is contained in:
parent
15345d44a7
commit
785b6cec67
@ -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)
|
||||
{
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user