mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2025-01-11 20:31:04 +03:00
Layout spacing has been fixed
This commit is contained in:
parent
505f1398e3
commit
35cd54919a
@ -34,7 +34,7 @@ public:
|
|||||||
int childrenCount();
|
int childrenCount();
|
||||||
int layoutSpacing() const;
|
int layoutSpacing() const;
|
||||||
void setLayoutSpacing(int layoutSpacing);
|
void setLayoutSpacing(int layoutSpacing);
|
||||||
|
qreal layoutSpacingMM(){ return m_layoutSpacing * mmFactor();}
|
||||||
protected:
|
protected:
|
||||||
void beforeDelete();
|
void beforeDelete();
|
||||||
void childAddedEvent(BaseDesignIntf *child);
|
void childAddedEvent(BaseDesignIntf *child);
|
||||||
|
@ -159,7 +159,7 @@ void HorizontalLayout::updateLayoutSize()
|
|||||||
}
|
}
|
||||||
if (h>0) setHeight(h+spaceBorder*2);
|
if (h>0) setHeight(h+spaceBorder*2);
|
||||||
if (layoutType() == Layout)
|
if (layoutType() == Layout)
|
||||||
setWidth(w + layoutSpacing() * (visibleItemCount-1));
|
setWidth(w + layoutSpacingMM() * (visibleItemCount-1));
|
||||||
else{
|
else{
|
||||||
relocateChildren();
|
relocateChildren();
|
||||||
if (!isRelocating()){
|
if (!isRelocating()){
|
||||||
@ -183,7 +183,7 @@ void HorizontalLayout::relocateChildren()
|
|||||||
foreach (BaseDesignIntf* item, layoutsChildren()) {
|
foreach (BaseDesignIntf* item, layoutsChildren()) {
|
||||||
if (item->isVisible() || itemMode() == DesignMode){
|
if (item->isVisible() || itemMode() == DesignMode){
|
||||||
item->setPos(curX,spaceBorder);
|
item->setPos(curX,spaceBorder);
|
||||||
curX += item->width() + layoutSpacing();
|
curX += item->width() + layoutSpacingMM();
|
||||||
item->setHeight(height()-(spaceBorder * 2));
|
item->setHeight(height()-(spaceBorder * 2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -203,7 +203,7 @@ void HorizontalLayout::divideSpace(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
itemsSumSize += layoutSpacing() * (visibleItemsCount-1);
|
itemsSumSize += layoutSpacingMM() * (visibleItemsCount-1);
|
||||||
|
|
||||||
if (itemMode() == DesignMode && !layoutsChildren().isEmpty()){
|
if (itemMode() == DesignMode && !layoutsChildren().isEmpty()){
|
||||||
qreal delta = (width() - (itemsSumSize+spaceBorder*2));
|
qreal delta = (width() - (itemsSumSize+spaceBorder*2));
|
||||||
|
@ -51,7 +51,7 @@ void VerticalLayout::updateLayoutSize()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (w>0) setWidth(w+spaceBorder*2);
|
if (w>0) setWidth(w+spaceBorder*2);
|
||||||
setHeight(h + layoutSpacing() *(visibleItemCount-1));
|
setHeight(h + layoutSpacingMM() *(visibleItemCount-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VerticalLayout::relocateChildren()
|
void VerticalLayout::relocateChildren()
|
||||||
@ -69,7 +69,7 @@ void VerticalLayout::relocateChildren()
|
|||||||
foreach (BaseDesignIntf* item, layoutsChildren()) {
|
foreach (BaseDesignIntf* item, layoutsChildren()) {
|
||||||
if (item->isVisible() || itemMode() == DesignMode){
|
if (item->isVisible() || itemMode() == DesignMode){
|
||||||
item->setPos(spaceBorder, curY);
|
item->setPos(spaceBorder, curY);
|
||||||
curY+=item->height() + layoutSpacing();
|
curY+=item->height() + layoutSpacingMM();
|
||||||
item->setWidth(width() - (spaceBorder * 2));
|
item->setWidth(width() - (spaceBorder * 2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -163,7 +163,7 @@ void VerticalLayout::divideSpace()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
itemsSumSize += layoutSpacing() * (visibleItemsCount - 1);
|
itemsSumSize += layoutSpacingMM() * (visibleItemsCount - 1);
|
||||||
qreal delta = (height() - (itemsSumSize+spaceBorder*2)) / (visibleItemsCount!=0 ? visibleItemsCount : 1);
|
qreal delta = (height() - (itemsSumSize+spaceBorder*2)) / (visibleItemsCount!=0 ? visibleItemsCount : 1);
|
||||||
|
|
||||||
for (int i=0; i<layoutsChildren().size(); ++i){
|
for (int i=0; i<layoutsChildren().size(); ++i){
|
||||||
|
Loading…
Reference in New Issue
Block a user