mirror of
https://github.com/fralx/LimeReport.git
synced 2025-01-11 17:18:10 +03:00
Default band's background filling mode changed to transparent
This commit is contained in:
parent
1bb6fc8f5a
commit
ed28faf784
@ -54,11 +54,11 @@ void BandMarker::paint(QPainter *painter, const QStyleOptionGraphicsItem* /**opt
|
|||||||
painter->setOpacity(Const::BAND_MARKER_OPACITY);
|
painter->setOpacity(Const::BAND_MARKER_OPACITY);
|
||||||
painter->fillRect(boundingRect(),m_color);
|
painter->fillRect(boundingRect(),m_color);
|
||||||
painter->setOpacity(1);
|
painter->setOpacity(1);
|
||||||
painter->setPen(QPen(QBrush(Qt::white),2));
|
painter->setPen(QPen(QBrush(Qt::lightGray),2));
|
||||||
painter->fillRect(QRectF(
|
painter->fillRect(QRectF(
|
||||||
boundingRect().bottomLeft().x(),
|
boundingRect().bottomLeft().x(),
|
||||||
boundingRect().bottomLeft().y()-4,
|
boundingRect().bottomLeft().y()-4,
|
||||||
boundingRect().width(),4), Qt::white
|
boundingRect().width(),4), Qt::lightGray
|
||||||
);
|
);
|
||||||
|
|
||||||
painter->setRenderHint(QPainter::Antialiasing);
|
painter->setRenderHint(QPainter::Antialiasing);
|
||||||
@ -175,6 +175,8 @@ BandDesignIntf::BandDesignIntf(BandsType bandType, const QString &xmlTypeName, Q
|
|||||||
if (parentItem) setWidth(parentItem->width());
|
if (parentItem) setWidth(parentItem->width());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setBackgroundMode(BGMode::TransparentMode);
|
||||||
|
setFillTransparentInDesignMode(false);
|
||||||
setHeight(100);
|
setHeight(100);
|
||||||
setFixedPos(true);
|
setFixedPos(true);
|
||||||
setFlag(QGraphicsItem::ItemClipsChildrenToShape);
|
setFlag(QGraphicsItem::ItemClipsChildrenToShape);
|
||||||
|
@ -82,7 +82,8 @@ BaseDesignIntf::BaseDesignIntf(const QString &storageTypeName, QObject *owner, Q
|
|||||||
m_watermark(false),
|
m_watermark(false),
|
||||||
m_hovered(false),
|
m_hovered(false),
|
||||||
m_joinMarkerOn(false),
|
m_joinMarkerOn(false),
|
||||||
m_selectionMarker(0)
|
m_selectionMarker(0),
|
||||||
|
m_fillTransparentInDesignMode(true)
|
||||||
{
|
{
|
||||||
setGeometry(QRectF(0, 0, m_width, m_height));
|
setGeometry(QRectF(0, 0, m_width, m_height));
|
||||||
if (BaseDesignIntf *item = dynamic_cast<BaseDesignIntf *>(parent)) {
|
if (BaseDesignIntf *item = dynamic_cast<BaseDesignIntf *>(parent)) {
|
||||||
@ -430,7 +431,7 @@ void BaseDesignIntf::prepareRect(QPainter *painter, const QStyleOptionGraphicsIt
|
|||||||
qreal o = (itemMode() & DesignMode) ? 0.5 : qreal(m_opacity) / 100;
|
qreal o = (itemMode() & DesignMode) ? 0.5 : qreal(m_opacity) / 100;
|
||||||
painter->setOpacity(o);
|
painter->setOpacity(o);
|
||||||
painter->fillRect(r, brush);
|
painter->fillRect(r, brush);
|
||||||
} else if (itemMode() & DesignMode){
|
} else if ((itemMode() & DesignMode) && fillTransparentInDesignMode()){
|
||||||
painter->setOpacity(0.1);
|
painter->setOpacity(0.1);
|
||||||
painter->fillRect(r, QBrush(QPixmap(":/report/images/empty")));
|
painter->fillRect(r, QBrush(QPixmap(":/report/images/empty")));
|
||||||
}
|
}
|
||||||
@ -721,6 +722,16 @@ void BaseDesignIntf::updatePossibleDirectionFlags(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool BaseDesignIntf::fillTransparentInDesignMode() const
|
||||||
|
{
|
||||||
|
return m_fillTransparentInDesignMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BaseDesignIntf::setFillTransparentInDesignMode(bool fillTransparentInDesignMode)
|
||||||
|
{
|
||||||
|
m_fillTransparentInDesignMode = fillTransparentInDesignMode;
|
||||||
|
}
|
||||||
|
|
||||||
bool BaseDesignIntf::fillInSecondPass() const
|
bool BaseDesignIntf::fillInSecondPass() const
|
||||||
{
|
{
|
||||||
return m_fillInSecondPass;
|
return m_fillInSecondPass;
|
||||||
|
@ -295,6 +295,9 @@ public:
|
|||||||
Q_INVOKABLE QString setItemPosX(qreal xValue);
|
Q_INVOKABLE QString setItemPosX(qreal xValue);
|
||||||
Q_INVOKABLE QString setItemPosY(qreal yValue);
|
Q_INVOKABLE QString setItemPosY(qreal yValue);
|
||||||
|
|
||||||
|
bool fillTransparentInDesignMode() const;
|
||||||
|
void setFillTransparentInDesignMode(bool fillTransparentInDesignMode);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
//ICollectionContainer
|
//ICollectionContainer
|
||||||
@ -418,6 +421,7 @@ private:
|
|||||||
bool m_joinMarkerOn;
|
bool m_joinMarkerOn;
|
||||||
SelectionMarker* m_selectionMarker;
|
SelectionMarker* m_selectionMarker;
|
||||||
Marker* m_joinMarker;
|
Marker* m_joinMarker;
|
||||||
|
bool m_fillTransparentInDesignMode;
|
||||||
signals:
|
signals:
|
||||||
void geometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry);
|
void geometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry);
|
||||||
void posChanging(QObject* object, QPointF newPos, QPointF oldPos);
|
void posChanging(QObject* object, QPointF newPos, QPointF oldPos);
|
||||||
|
@ -2481,7 +2481,7 @@ CommandIf::Ptr BandMoveFromToCommand::create(PageDesignIntf* page, int from, int
|
|||||||
|
|
||||||
bool BandMoveFromToCommand::doIt()
|
bool BandMoveFromToCommand::doIt()
|
||||||
{
|
{
|
||||||
if (page() && from != to) {
|
if (page() && page()->pageItem() && from != to) {
|
||||||
page()->pageItem()->moveBandFromTo(from, to);
|
page()->pageItem()->moveBandFromTo(from, to);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user