0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-24 00:33:02 +03:00

Layout spacing has been fixed

This commit is contained in:
Arin Alexander 2019-02-06 18:41:56 +03:00
parent 505f1398e3
commit 35cd54919a
3 changed files with 7 additions and 7 deletions

View File

@ -34,7 +34,7 @@ public:
int childrenCount();
int layoutSpacing() const;
void setLayoutSpacing(int layoutSpacing);
qreal layoutSpacingMM(){ return m_layoutSpacing * mmFactor();}
protected:
void beforeDelete();
void childAddedEvent(BaseDesignIntf *child);

View File

@ -159,7 +159,7 @@ void HorizontalLayout::updateLayoutSize()
}
if (h>0) setHeight(h+spaceBorder*2);
if (layoutType() == Layout)
setWidth(w + layoutSpacing() * (visibleItemCount-1));
setWidth(w + layoutSpacingMM() * (visibleItemCount-1));
else{
relocateChildren();
if (!isRelocating()){
@ -183,7 +183,7 @@ void HorizontalLayout::relocateChildren()
foreach (BaseDesignIntf* item, layoutsChildren()) {
if (item->isVisible() || itemMode() == DesignMode){
item->setPos(curX,spaceBorder);
curX += item->width() + layoutSpacing();
curX += item->width() + layoutSpacingMM();
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()){
qreal delta = (width() - (itemsSumSize+spaceBorder*2));

View File

@ -51,7 +51,7 @@ void VerticalLayout::updateLayoutSize()
}
}
if (w>0) setWidth(w+spaceBorder*2);
setHeight(h + layoutSpacing() *(visibleItemCount-1));
setHeight(h + layoutSpacingMM() *(visibleItemCount-1));
}
void VerticalLayout::relocateChildren()
@ -69,7 +69,7 @@ void VerticalLayout::relocateChildren()
foreach (BaseDesignIntf* item, layoutsChildren()) {
if (item->isVisible() || itemMode() == DesignMode){
item->setPos(spaceBorder, curY);
curY+=item->height() + layoutSpacing();
curY+=item->height() + layoutSpacingMM();
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);
for (int i=0; i<layoutsChildren().size(); ++i){