Index: resources/iconsets/1_7_0/1_7_0.xml
===================================================================
--- resources/iconsets/1_7_0/1_7_0.xml	(Revision 26796)
+++ resources/iconsets/1_7_0/1_7_0.xml	(Arbeitskopie)
@@ -367,6 +367,7 @@
 		<icon id="folder" file="16/file-open.svg" />
 				
 		<!-- Page & Layer -->
+		<icon id="border-all" file="16/border-all.svg" />
 		<icon id="border-bottom" file="16/border-bottom.svg" />
 		<icon id="border-inside" file="16/border-inside.svg" />
 		<icon id="border-left" file="16/border-left.svg" />
Index: scribus/margins.h
===================================================================
--- scribus/margins.h	(Revision 26796)
+++ scribus/margins.h	(Arbeitskopie)
@@ -42,12 +42,36 @@
 		inline void setRight(double aright) { m_right = aright; }
 		inline void setBottom(double abottom) { m_bottom = abottom; }
 
+		bool operator==(const MarginStruct &other) const
+		{
+			return ((m_left == other.m_left) && (m_top == other.m_top) && (m_right == other.m_right) && (m_bottom == other.m_bottom));
+		}
 
+		void fromString(const QString &string)
+		{
+			resetToZero();
+			QStringList s = string.split(" ");
+			if (s.size() == 4) // l t r b
+				set(convert(s.at(1)), convert(s.at(0)), convert(s.at(3)), convert(s.at(2)));
+		}
+
+		QString toString() const
+		{
+			return QString("%0 %1 %2 %3").arg(QString::number(m_left)).arg(QString::number(m_top)).arg(QString::number(m_right)).arg(QString::number(m_bottom));
+		}
+
 	protected:
 		double m_top {0.0};
 		double m_left {0.0};
 		double m_bottom {0.0};
 		double m_right {0.0};
+
+		double convert(const QString& s)
+		{
+			bool ok(false);
+			double number = s.toDouble(&ok);
+			return ok ? number : 0.0;
+		}
 };
 
 class ScMargins : public QMarginsF
Index: scribus/pageitem.cpp
===================================================================
--- scribus/pageitem.cpp	(Revision 26796)
+++ scribus/pageitem.cpp	(Arbeitskopie)
@@ -1954,6 +1954,7 @@
 void PageItem::DrawObj_Decoration(ScPainter *p)
 {
 	p->save();
+	p->setPenOpacity(1.0);
 //	p->setAntialiasing(false);
 	if (!isEmbedded)
 		p->translate(m_xPos, m_yPos);
@@ -1997,12 +1998,10 @@
 				p->strokePath();
 			}
 		}
-		if ((m_Doc->guidesPrefs().framesShown) && textFlowUsesContourLine() && (!ContourLine.empty()))
-		{
-			p->setPen(Qt::darkGray, 0, Qt::DotLine, Qt::FlatCap, Qt::MiterJoin);
-			p->setupSharpPolygon(&ContourLine);
-			p->strokePath();
-		}
+
+		drawContourLine(p);
+		drawTextFlowPath(p);
+
 		if (itemType() == ImageFrame)
 		{
 			double minres = m_Doc->checkerProfiles()[m_Doc->curCheckProfile()].minResolution;
@@ -2388,6 +2387,29 @@
 	p->drawPolygon(pts.constData() + firstVal, pts.size() - firstVal);
 }
 
+void PageItem::setShape(const FPointArray &val)
+{
+	PoLine = val;
+
+	if (textFlowUsesFrameShape())
+	{
+		m_textFlowMarginsNeedUpdate = true;
+		checkChanges();
+	}
+
+}
+
+void PageItem::setContour(const FPointArray &val)
+{
+	ContourLine = val;
+
+	if (textFlowUsesContourLine())
+	{
+		m_textFlowMarginsNeedUpdate = true;
+		checkChanges();
+	}
+}
+
 void PageItem::setItemName(const QString& newName)
 {
 	if (m_itemName == newName || newName.isEmpty())
@@ -4443,31 +4465,39 @@
 	m_PrintEnabled=!m_PrintEnabled;
 }
 
-void PageItem::setTextFlowMode(TextFlowMode mode)
+void PageItem::setTextFlowMode(TextFlowMode mode, MarginStruct distances)
 {
-	if (m_textFlowMode == mode)
-		return;
-	if (UndoManager::undoEnabled())
+	if (m_textFlowMargins != distances)
 	{
-		QString stateMessage;
-		if (mode == TextFlowUsesFrameShape)
-			stateMessage = Um::ObjectFrame;
-		else if (mode == TextFlowUsesBoundingBox)
-			stateMessage = Um::BoundingBox;
-		else if (mode == TextFlowUsesContourLine)
-			stateMessage = Um::ContourLine;
-		else if (mode == TextFlowUsesImageClipping)
-			stateMessage = Um::ImageClip;
-		else
-			stateMessage = Um::NoTextFlow;
-		auto *ss = new SimpleState(stateMessage, QString(), Um::IFont);
-		ss->set("TEXTFLOW_OLDMODE", (int) m_textFlowMode);
-		ss->set("TEXTFLOW_NEWMODE", (int) mode);
-		undoManager->action(this, ss);
+		m_textFlowMargins = distances;
+		m_textFlowMarginsNeedUpdate = true;
 	}
-	m_textFlowMode = mode;
-	
-	checkTextFlowInteractions();
+
+	if (m_textFlowMode != mode)
+	{
+		if (UndoManager::undoEnabled())
+		{
+			QString stateMessage;
+			if (mode == TextFlowUsesFrameShape)
+				stateMessage = Um::ObjectFrame;
+			else if (mode == TextFlowUsesBoundingBox)
+				stateMessage = Um::BoundingBox;
+			else if (mode == TextFlowUsesContourLine)
+				stateMessage = Um::ContourLine;
+			else if (mode == TextFlowUsesImageClipping)
+				stateMessage = Um::ImageClip;
+			else
+				stateMessage = Um::NoTextFlow;
+			auto *ss = new SimpleState(stateMessage, QString(), Um::IFont);
+			ss->set("TEXTFLOW_OLDMODE", (int) m_textFlowMode);
+			ss->set("TEXTFLOW_NEWMODE", (int) mode);
+			undoManager->action(this, ss);
+		}
+		m_textFlowMode = mode;
+		m_textFlowMarginsNeedUpdate = true;
+	}
+
+	checkChanges();
 }
 
 void PageItem::checkTextFlowInteractions(bool allItems)
@@ -4597,7 +4627,7 @@
 	{
 		if ((oldXpos  != m_xPos  || oldYpos != m_yPos) ||
 			(oldWidth != m_width || oldHeight != m_height) ||
-			(oldRot != m_rotation))
+			(oldRot != m_rotation || m_textFlowMarginsNeedUpdate))
 		{
 			textFlowCheckRect = getOldBoundingRect();
 			QRectF rect1 = textInteractionRegion(0.0, 0.0).boundingRect().adjusted(-1, -1, 1, 1);
@@ -4605,6 +4635,8 @@
 			rect2.setWidth(qMax(1.0, rect1.width() + oldWidth - m_width));
 			rect2.setHeight(qMax(1.0, rect1.height() + oldHeight - m_height));
 			textFlowCheckRect = textFlowCheckRect.united(rect1.united(rect2));
+			spreadChanges = true;
+			m_textFlowMarginsNeedUpdate = false;
 		}
 	}
 
@@ -4615,7 +4647,7 @@
 		spreadChanges = (textFlowMode() != TextFlowDisabled);
 	}
 	// has the item been rotated
-	if (force || ((oldRot != m_rotation) && (shouldCheck())))
+	if (force || ((oldRot != m_rotation) && shouldCheck()))
 	{
 		rotateUndoAction();
 		spreadChanges = (textFlowMode() != TextFlowDisabled);
@@ -9089,6 +9121,9 @@
 		PoLine.addPoint(x1, y1);
 		PoLine.addPoint(x2, y2);
 	}
+
+	setShape(PoLine);
+
 	Clip = flattenPath(PoLine, Segments);
 	ClipEdited = true;
 }
@@ -9149,6 +9184,9 @@
 		PoLine.addQuadPoint(0, Height_rr, 0, Height_rr, 0, rr, 0, rr);
 		PoLine.addQuadPoint(0, rr, rrxBezierFactor, rr, rr, 0, rr, rr*bezierFactor);
 	}
+
+	setShape(PoLine);
+
 	Clip = flattenPath(PoLine, Segments);
 	ClipEdited = false;
 	FrameType = 2;
@@ -9664,19 +9702,14 @@
 	return arrowRect;
 }
 
-QRegion PageItem::textInteractionRegion(double xOffset, double yOffset) const
+QPainterPath PageItem::createTextFlowPath(double xOffset, double yOffset)
 {
-	QRegion res;
-	if (m_textFlowMode == TextFlowDisabled)
-		return res;
+	QPainterPath pathOut;
 
-	QTransform pp;
-	if (this->isGroupChild())
-		pp.translate(gXpos, gYpos);
-	else
-		pp.translate(m_xPos - xOffset, m_yPos - yOffset);
-	pp.rotate(m_rotation);
+	if (textFlowMode() == TextFlowDisabled)
+		return pathOut;
 
+	// Bounding Box
 	if (textFlowUsesBoundingBox())
 	{
 		QRectF bb = getVisualBoundingRect();
@@ -9685,19 +9718,37 @@
 			bb.translate(-m_xPos, -m_yPos);
 			bb.translate(gXpos, gYpos);
 		}
-		res = QRegion(bb.toRect());
+
+		pathOut.addRect(bb.adjusted(-m_textFlowMargins.left(), -m_textFlowMargins.top(), m_textFlowMargins.right(), m_textFlowMargins.bottom()));
+		setTextFlowPath(pathOut);
+		return pathOut;
 	}
-	else if ((textFlowUsesImageClipping()) && (!imageClip.empty()))
+
+	QPainterPath shape;
+	QPolygonF poly;
+	QTransform pp;
+	bool strokePath = false;
+
+	if (this->isGroupChild())
+		pp.translate(gXpos, gYpos);
+	else
+		pp.translate(m_xPos - xOffset, m_yPos - yOffset);
+
+	pp.rotate(m_rotation);
+
+	// Image Clipping Path
+	if ((textFlowUsesImageClipping()) && (!imageClip.empty()))
 	{
-		QList<uint> Segs;
-		QPolygon Clip2 = flattenPath(imageClip, Segs);
-		res = QRegion(pp.map(Clip2)).intersected(QRegion(pp.map(Clip)));
+		shape = pp.map(imageClip.toQPainterPath(true));
+		poly = shape.toFillPolygon();
+		strokePath = true;
 	}
+	//Contour Line
 	else if ((textFlowUsesContourLine()) && (!ContourLine.empty()))
 	{
-		QList<uint> Segs;
-		QPolygon Clip2 = flattenPath(ContourLine, Segs);
-		res = QRegion(pp.map(Clip2));
+		shape = pp.map(ContourLine.toQPainterPath(true));
+		poly = shape.toFillPolygon();
+		strokePath = true;
 	}
 	else
 	{
@@ -9714,14 +9765,19 @@
 				pp.scale(1, -1);
 			}
 		}
+
+		poly = pp.map(Clip);
+
+		// Shape with Stroke
 		if ((((m_lineColor != CommonStrings::None) || (!patternStrokeVal.isEmpty()) || (GrTypeStroke > 0)) && (m_lineWidth > 1)) || (!NamedLStyle.isEmpty()))
 		{
 			QPainterPath ppa;
-			QPainterPath result;
+			// QPainterPath result;
 			if (itemType() == PageItem::PolyLine)
 				ppa = PoLine.toQPainterPath(false);
 			else
 				ppa = PoLine.toQPainterPath(true);
+
 			if (NamedLStyle.isEmpty())
 			{
 				QPainterPathStroker stroke;
@@ -9728,8 +9784,8 @@
 				stroke.setCapStyle(PLineEnd);
 				stroke.setJoinStyle(PLineJoin);
 				stroke.setDashPattern(Qt::SolidLine);
-				stroke.setWidth(m_lineWidth);
-				result = stroke.createStroke(ppa);
+				stroke.setWidth(m_lineWidth + m_textFlowMargins.left() * 2.0);
+				shape = pp.map(stroke.createStroke(ppa));
 			}
 			else
 			{
@@ -9741,23 +9797,51 @@
 					stroke.setCapStyle(static_cast<Qt::PenCapStyle>(ml[ind].LineEnd));
 					stroke.setJoinStyle(static_cast<Qt::PenJoinStyle>(ml[ind].LineJoin));
 					stroke.setDashPattern(Qt::SolidLine);
-					stroke.setWidth(ml[ind].Width);
-					result = stroke.createStroke(ppa);
+					stroke.setWidth(ml[ind].Width + m_textFlowMargins.left() * 2.0);
+					shape = pp.map(stroke.createStroke(ppa));
 				}
-			}
-			res = QRegion(pp.map(Clip));
-			QList<QPolygonF> pl = result.toSubpathPolygons();
-			for (int b = 0; b < pl.count(); b++)
-			{
-				res = res.united(QRegion(pp.map(pl[b].toPolygon())));
-			}
+			}			
 		}
+		// Shape without Stroke
 		else
-			res = QRegion(pp.map(Clip));
+		{
+			shape.addPolygon(poly);
+			shape.closeSubpath();
+
+			strokePath = true;
+		}
 	}
-	return  res;
+
+	// TODO: nitramr: Replace QPainterPathStroker with a more performant path offset method.
+	if (strokePath)
+	{
+		QPainterPathStroker stroke;
+		stroke.setWidth(m_textFlowMargins.left() * 2.0);
+		stroke.setJoinStyle(Qt::MiterJoin);
+		shape = stroke.createStroke(shape);
+	}
+
+	shape = shape.simplified();
+
+	QList<QPolygonF> pl = shape.toSubpathPolygons();
+	for (int b = 0; b < pl.count(); b++)
+	{
+		poly = poly.united(pl[b].toPolygon());
+	}
+
+	pathOut.addPolygon(poly);
+	pathOut = pathOut.simplified();
+
+	setTextFlowPath(pathOut);
+
+	return  pathOut;
 }
 
+QRegion PageItem::textInteractionRegion(double xOffset, double yOffset)
+{
+	return QRegion(createTextFlowPath(xOffset, yOffset).toFillPolygon().toPolygon());
+}
+
 bool PageItem::pointWithinItem(int x, const int y) const
 {
 	const_cast<PageItem*>(this)->setRedrawBounding();
@@ -10132,6 +10216,37 @@
 	p->drawLine(FPoint(bx1 + scp1 / 2, ofy + scp1), FPoint(bx1 + scp1 * 3.5, ofy + scp1));
 }
 
+void PageItem::drawTextFlowPath(ScPainter *p) const
+{
+	bool usesTextFlowBoundingBox = textFlowUsesBoundingBox() && (m_textFlowMargins.left() > 0 || m_textFlowMargins.top() > 0 || m_textFlowMargins.right() > 0 || m_textFlowMargins.left() > 0);
+	bool usesTextFlowAround = textFlowAroundObject() && m_textFlowMargins.left() > 0;
+
+	// Draw Text Flow Margin Path
+	if (m_Doc->guidesPrefs().framesShown && (usesTextFlowBoundingBox || usesTextFlowAround))
+	{
+		QTransform tf;
+		tf.rotate(-m_rotation);
+		tf.translate(-m_xPos, -m_yPos);
+		QPainterPath qpp = tf.map(textFlowPath());
+		FPointArray tfMargin;
+		tfMargin.fromQPainterPath(qpp);
+		// Color: Scribus Blue 200, https://wiki.scribus.net/canvas/IndigoUI_Style_Guide#Colors
+		p->setPen(QColor(168, 220, 248), 0, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+		p->setupSharpPolygon(&tfMargin);
+		p->strokePath();
+	}
+}
+
+void PageItem::drawContourLine(ScPainter *p) const
+{
+	if (m_Doc->guidesPrefs().framesShown && textFlowUsesContourLine() && (!ContourLine.empty()))
+	{
+		p->setPen(Qt::darkGray, 0, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+		p->setupSharpPolygon(&ContourLine);
+		p->strokePath();
+	}
+}
+
 void PageItem::drawArrow(ScPainter *p, QTransform &arrowTrans, int arrowIndex)
 {
 	FPointArray arrow = m_Doc->arrowStyles().at(arrowIndex - 1).points.copy();
Index: scribus/pageitem.h
===================================================================
--- scribus/pageitem.h	(Revision 26796)
+++ scribus/pageitem.h	(Arbeitskopie)
@@ -338,7 +338,7 @@
 	virtual QRectF getEndArrowBoundingRect() const;
 	virtual QRectF getEndArrowOldBoundingRect() const;
 
-	virtual QRegion textInteractionRegion(double xOffset, double yOffset) const;
+	virtual QRegion textInteractionRegion(double xOffset, double yOffset);
 
 	//>> ********* Functions related to drawing the item *********
 
@@ -453,9 +453,9 @@
 	void SetQColor(QColor *tmp, const QString& farbe, double shad);
 	void DrawPolyL(QPainter *p, const QPolygon& pts);
 	FPointArray shape() const { return PoLine; }
-	void setShape(const FPointArray& val) { PoLine = val; }
+	void setShape(const FPointArray& val);
 	FPointArray contour() const { return ContourLine; }
-	void setContour(const FPointArray& val) { ContourLine = val; }
+	void setContour(const FPointArray& val);
 	bool flipPathText() const { return textPathFlipped; }
 	void setFlipPathText(bool val) { textPathFlipped = val; }
 	int pathTextType() const { return textPathType; }
@@ -1117,8 +1117,14 @@
 	 * @param mode true if text is wanted to flow around this object or false if not
 	 * @sa textFlowMode()
 	 */
-	void setTextFlowMode(TextFlowMode mode);
+	void setTextFlowMode(TextFlowMode mode, MarginStruct distances = MarginStruct());
 
+	MarginStruct textFlowMargins() { return m_textFlowMargins; }
+	QPainterPath createTextFlowPath(double xOffset, double yOffset);
+
+	void setTextFlowPath(const QPainterPath path) { m_textFlowPath = path; }
+	QPainterPath textFlowPath() const { return m_textFlowPath; }
+
 	/**
 	 * @brief If text should flow around object frame
 	 * @sa PageItem::setTextFlowMode()
@@ -1533,6 +1539,8 @@
 	void DrawObj_PolyLine(ScPainter *p);
 	void DrawObj_PathText(ScPainter *p, double sc);
 	void drawLockedMarker(ScPainter *p) const;
+	void drawTextFlowPath(ScPainter *p) const;
+	void drawContourLine(ScPainter *p) const;
 	void drawArrow(ScPainter *p, QTransform &arrowTrans, int arrowIndex);
 
 	/** @brief Manages undostack and is where all undo actions/states are sent. */
@@ -1848,6 +1856,9 @@
 	 * @sa PageItem::textFlowMode(), PateItem::setTextFlowMode()
 	 */
 	TextFlowMode m_textFlowMode {TextFlowDisabled};
+	MarginStruct m_textFlowMargins;
+	QPainterPath m_textFlowPath;
+	bool m_textFlowMarginsNeedUpdate {false};
 
 	/**
 	 * @brief Stores the attributes of the pageitem (NOT properties, the user defined ATTRIBUTES)
Index: scribus/pageitem_textframe.cpp
===================================================================
--- scribus/pageitem_textframe.cpp	(Revision 26796)
+++ scribus/pageitem_textframe.cpp	(Arbeitskopie)
@@ -3587,6 +3587,7 @@
 	//#12405 if (isAnnotation() && ((annotation().Type() > 1) && (annotation().Type() < 7)) && (annotation().borderWidth() > 0))
 	//	return;
 	p->save();
+	p->setPenOpacity(1.0);
 //	p->setAntialiasing(false);
 	if (!isEmbedded)
 		p->translate(m_xPos, m_yPos);
@@ -3608,13 +3609,10 @@
 			p->setupSharpPolygon(&PoLine);
 			p->strokePath();
 		}
-		if ((m_Doc->guidesPrefs().framesShown) && textFlowUsesContourLine() && (!ContourLine.empty()))
-		{
-			p->setPen(Qt::darkGray, 0, Qt::DotLine, Qt::FlatCap, Qt::MiterJoin);
-			p->setupSharpPolygon(&ContourLine);
-			p->strokePath();
-		}
 
+		drawContourLine(p);
+		drawTextFlowPath(p);
+
 		//Draw the overflow icon
 		if (frameOverflows())
 		{
Index: scribus/plugins/fileloader/scribus170format/scribus170format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus170format/scribus170format.cpp	(Revision 26796)
+++ scribus/plugins/fileloader/scribus170format/scribus170format.cpp	(Arbeitskopie)
@@ -5842,8 +5842,12 @@
 	currItem->BaseOffs     = attrs.valueAsDouble("BASEOF", 0.0);
 	currItem->textPathType =  attrs.valueAsInt("textPathType", 0);
 	currItem->textPathFlipped = attrs.valueAsBool("textPathFlipped", false);
+
+	MarginStruct textFlowMargins;
+	textFlowMargins.fromString(attrs.valueAsString("TextFlowMargins", "0 0 0 0"));
+
 	if ( attrs.hasAttribute("TEXTFLOWMODE") )
-		currItem->setTextFlowMode((PageItem::TextFlowMode) attrs.valueAsInt("TEXTFLOWMODE", 0));
+		currItem->setTextFlowMode((PageItem::TextFlowMode) attrs.valueAsInt("TEXTFLOWMODE", 0), textFlowMargins);
 	else if ( attrs.valueAsInt("TEXTFLOW", 0) != 0)
 	{
 		if (attrs.valueAsInt("TEXTFLOW2", 0))
@@ -5851,7 +5855,7 @@
 		else if (attrs.valueAsInt("TEXTFLOW3", 0))
 			currItem->setTextFlowMode(PageItem::TextFlowUsesContourLine);
 		else
-			currItem->setTextFlowMode(PageItem::TextFlowUsesFrameShape);	
+			currItem->setTextFlowMode(PageItem::TextFlowUsesFrameShape);
 	}
 	else
 		currItem->setTextFlowMode(PageItem::TextFlowDisabled);
Index: scribus/plugins/fileloader/scribus170format/scribus170format_save.cpp
===================================================================
--- scribus/plugins/fileloader/scribus170format/scribus170format_save.cpp	(Revision 26796)
+++ scribus/plugins/fileloader/scribus170format/scribus170format_save.cpp	(Arbeitskopie)
@@ -2868,7 +2868,10 @@
 		docu.writeAttribute("ANNAME", item->itemName());
 	// "TEXTFLOWMODE" succeed to "TEXTFLOW" "TEXTFLOW2" and "TEXTFLOW3" attributes
 	if (item->textFlowMode() != 0)
+	{
 		docu.writeAttribute("TEXTFLOWMODE", (int) item->textFlowMode() );
+		docu.writeAttribute("TextFlowMargins", item->textFlowMargins().toString());
+	}
 	// Set "TEXTFLOW" "TEXTFLOW2" and "TEXTFLOW3" attributes for compatibility
 	// with versions prior to 1.3.4
 //	docu.writeAttribute("TEXTFLOW" , item->textFlowAroundObject() ? 1 : 0);
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(Revision 26796)
+++ scribus/scribus.cpp	(Arbeitskopie)
@@ -2723,7 +2723,7 @@
 		actionManager->setPDFActions(view);
 		updateItemLayerList();
 		rebuildScrapbookMenu();
-		propertiesPalette->setTextFlowMode(currItem->textFlowMode());
+		propertiesPalette->setTextFlowMode(currItem->textFlowMode(), currItem->textFlowMargins());
 	}
 
 	if (selectedType != -1)
Index: scribus/ui/newmarginwidget.cpp
===================================================================
--- scribus/ui/newmarginwidget.cpp	(Revision 26796)
+++ scribus/ui/newmarginwidget.cpp	(Arbeitskopie)
@@ -74,57 +74,71 @@
 	{
 		topMarginSpinBox->setToolTip( "<qt>" + tr( "Distance between the top margin guide and the edge of the page" ) + "</qt>");
 		bottomMarginSpinBox->setToolTip( "<qt>" + tr( "Distance between the bottom margin guide and the edge of the page" ) + "</qt>");
-		leftMarginSpinBox->setToolTip( "<qt>" + tr( "Distance between the left margin guide and the edge of the page. If a double-sided layout is selected, this margin space can be used to achieve the correct margins for binding.") + "</qt>");
-		rightMarginSpinBox->setToolTip( "<qt>" + tr( "Distance between the right margin guide and the edge of the page. If a double-sided layout is selected, this margin space can be used to achieve the correct margins for binding.") + "</qt>");
+		leftMarginSpinBox->setToolTip( "<qt>" + tr( "Distance between the left margin guide and the edge of the page. If a double-sided layout is selected, this margin space can be used to achieve the correct margins for binding.") + "</qt>");
+		rightMarginSpinBox->setToolTip( "<qt>" + tr( "Distance between the right margin guide and the edge of the page. If a double-sided layout is selected, this margin space can be used to achieve the correct margins for binding.") + "</qt>");
 		marginLinkButton->setToolTip( "<qt>" + tr( "Ensure all margins have the same value" ) + "</qt>");
 	}
-	else if (m_flags & BleedWidgetFlags)
+	else if (m_flags & BleedWidgetFlags)
 	{
 		topMarginSpinBox->setToolTip( "<qt>" + tr( "Distance for bleed from the top of the physical page" ) + "</qt>" );
 		bottomMarginSpinBox->setToolTip( "<qt>" + tr( "Distance for bleed from the bottom of the physical page" ) + "</qt>" );
-		leftMarginSpinBox->setToolTip( "<qt>" + tr( "Distance for bleed from the left of the physical page" ) + "</qt>" );
+		if (isSingleMode())
+			leftMarginSpinBox->setToolTip( "<qt>" + tr( "Distance for bleed around the physical page" ) + "</qt>" );
+		else
+			leftMarginSpinBox->setToolTip( "<qt>" + tr( "Distance for bleed from the left of the physical page" ) + "</qt>" );
 		rightMarginSpinBox->setToolTip( "<qt>" + tr( "Distance for bleed from the right of the physical page" )  + "</qt>");
 		marginLinkButton->setToolTip( "<qt>" + tr( "Ensure all bleeds have the same value" ) + "</qt>");
 	}
-	else
-	{
-		topMarginSpinBox->setToolTip( "<qt>" + tr( "Distance from the top" ) + "</qt>" );
-		bottomMarginSpinBox->setToolTip( "<qt>" + tr( "Distance from the bottom" ) + "</qt>" );
-		leftMarginSpinBox->setToolTip( "<qt>" + tr( "Distance from the left" ) + "</qt>" );
-		rightMarginSpinBox->setToolTip( "<qt>" + tr( "Distance from the right" )  + "</qt>");
-		marginLinkButton->setToolTip( "<qt>" + tr( "Ensure all distances have the same value" ) + "</qt>");
-	}
+	else
+	{
+		topMarginSpinBox->setToolTip( "<qt>" + tr( "Distance from the top" ) + "</qt>" );
+		bottomMarginSpinBox->setToolTip( "<qt>" + tr( "Distance from the bottom" ) + "</qt>" );
+		if (isSingleMode())
+			leftMarginSpinBox->setToolTip( "<qt>" + tr( "Distance around the object" ) + "</qt>" );
+		else
+			leftMarginSpinBox->setToolTip( "<qt>" + tr( "Distance from the left" ) + "</qt>" );
+		rightMarginSpinBox->setToolTip( "<qt>" + tr( "Distance from the right" )  + "</qt>");
+		marginLinkButton->setToolTip( "<qt>" + tr( "Ensure all distances have the same value" ) + "</qt>");
+	}
 	printerMarginsPushButton->setToolTip( "<qt>" + tr( "Import the margins for the selected page size from the available printers" ) + "</qt>");
-
-	leftMarginLabel->setText( m_facingPages ? tr("Inside") : tr("Left"));
-	rightMarginLabel->setText( m_facingPages ? tr("Outside") : tr("Right"));
+
+	if (isSingleMode())
+		leftMarginLabel->setText( tr("Around"));
+	else
+		leftMarginLabel->setText( m_facingPages ? tr("Inside") : tr("Left"));
+
+	rightMarginLabel->setText( m_facingPages ? tr("Outside") : tr("Right"));
 }
 
-void NewMarginWidget::iconSetChange()
-{
-	IconManager &im = IconManager::instance();
-
-	leftMarginLabel->setPixmap(im.loadPixmap(m_facingPages ? "border-inside" : "border-left"));
-	rightMarginLabel->setPixmap(im.loadPixmap(m_facingPages ? "border-outside" : "border-right"));
-	topMarginLabel->setPixmap(im.loadPixmap("border-top"));
-	bottomMarginLabel->setPixmap(im.loadPixmap("border-bottom"));
-}
-
-void NewMarginWidget::toggleLabelVisibility(bool v)
-{
-	formWidget->setLabelVisibility(v);
-	leftMarginLabel->setLabelVisibility(v);
-	rightMarginLabel->setLabelVisibility(v);
-	topMarginLabel->setLabelVisibility(v);
-	bottomMarginLabel->setLabelVisibility(v);
-
-	leftMarginLabel->setIconVisibility(!v);
-	rightMarginLabel->setIconVisibility(!v);
-	topMarginLabel->setIconVisibility(!v);
-	bottomMarginLabel->setIconVisibility(!v);
-
-}
-
+void NewMarginWidget::iconSetChange()
+{
+	IconManager &im = IconManager::instance();
+
+	if (isSingleMode())
+		leftMarginLabel->setPixmap(im.loadPixmap("border-all"));
+	else
+		leftMarginLabel->setPixmap(im.loadPixmap(m_facingPages ? "border-inside" : "border-left"));
+
+	rightMarginLabel->setPixmap(im.loadPixmap(m_facingPages ? "border-outside" : "border-right"));
+	topMarginLabel->setPixmap(im.loadPixmap("border-top"));
+	bottomMarginLabel->setPixmap(im.loadPixmap("border-bottom"));
+}
+
+void NewMarginWidget::toggleLabelVisibility(bool v)
+{
+	formWidget->setLabelVisibility(v);
+	leftMarginLabel->setLabelVisibility(v);
+	rightMarginLabel->setLabelVisibility(v);
+	topMarginLabel->setLabelVisibility(v);
+	bottomMarginLabel->setLabelVisibility(v);
+
+	leftMarginLabel->setIconVisibility(!v);
+	rightMarginLabel->setIconVisibility(!v);
+	topMarginLabel->setIconVisibility(!v);
+	bottomMarginLabel->setIconVisibility(!v);
+
+}
+
 void NewMarginWidget::setNewValues(const MarginStruct& margs)
 {
 	m_marginData = m_savedMarginData = margs;
@@ -308,10 +322,10 @@
 
 void NewMarginWidget::updateMarginSpinValues()
 {
-	bool leftBlocked = leftMarginSpinBox->blockSignals(true);
-	bool rightBlocked = rightMarginSpinBox->blockSignals(true);
-	bool topBlocked = topMarginSpinBox->blockSignals(true);
-	bool bottomBlocked = bottomMarginSpinBox->blockSignals(true);
+	QSignalBlocker leftBlocked(leftMarginSpinBox);
+	QSignalBlocker rightBlocked(rightMarginSpinBox);
+	QSignalBlocker topBlocked(topMarginSpinBox);
+	QSignalBlocker bottomBlocked(bottomMarginSpinBox);
 
 	topMarginSpinBox->setValue(m_marginData.top() * m_unitRatio);
 	rightMarginSpinBox->setValue(m_marginData.right() * m_unitRatio);
@@ -318,34 +332,26 @@
 	bottomMarginSpinBox->setValue(m_marginData.bottom() * m_unitRatio);
 	leftMarginSpinBox->setValue(m_marginData.left() * m_unitRatio);
 
-	leftMarginSpinBox->blockSignals(leftBlocked);
-	rightMarginSpinBox->blockSignals(rightBlocked);
-	topMarginSpinBox->blockSignals(topBlocked);
-	bottomMarginSpinBox->blockSignals(bottomBlocked);
 }
 
 void NewMarginWidget::slotLinkMargins()
 {
-	bool leftBlocked = leftMarginSpinBox->blockSignals(true);
-	bool rightBlocked = rightMarginSpinBox->blockSignals(true);
-	bool topBlocked = topMarginSpinBox->blockSignals(true);
-	bool bottomBlocked = bottomMarginSpinBox->blockSignals(true);
+	if (!marginLinkButton->isChecked())
+		return;
 
-	if (marginLinkButton->isChecked())
-	{
-		bottomMarginSpinBox->setValue(leftMarginSpinBox->value());
-		topMarginSpinBox->setValue(leftMarginSpinBox->value());
-		rightMarginSpinBox->setValue(leftMarginSpinBox->value());
-		double newVal = leftMarginSpinBox->value() / m_unitRatio;
-		m_marginData.set(newVal, newVal, newVal, newVal);
-
-		emit marginChanged(m_marginData);
-	}
+	QSignalBlocker leftBlocked(leftMarginSpinBox);
+	QSignalBlocker rightBlocked(rightMarginSpinBox);
+	QSignalBlocker topBlocked(topMarginSpinBox);
+	QSignalBlocker bottomBlocked(bottomMarginSpinBox);
 
-	leftMarginSpinBox->blockSignals(leftBlocked);
-	rightMarginSpinBox->blockSignals(rightBlocked);
-	topMarginSpinBox->blockSignals(topBlocked);
-	bottomMarginSpinBox->blockSignals(bottomBlocked);
+	bottomMarginSpinBox->setValue(leftMarginSpinBox->value());
+	topMarginSpinBox->setValue(leftMarginSpinBox->value());
+	rightMarginSpinBox->setValue(leftMarginSpinBox->value());
+	double newVal = leftMarginSpinBox->value() / m_unitRatio;
+	m_marginData.set(newVal, newVal, newVal, newVal);
+
+	emit marginChanged(m_marginData);
+	emit valuesChanged(m_marginData);
 }
 
 void NewMarginWidget::setMarginPreset(int p)
@@ -386,15 +392,32 @@
 	presetLayoutComboBox->blockSignals(false);
 }
 
+void NewMarginWidget::setSingleMode(bool isSingle)
+{
+	m_isSingle = isSingle;
+
+	QSignalBlocker blocker(this);
+
+	topMarginLabel->setVisible(!isSingle);
+	rightMarginLabel->setVisible(!isSingle);
+	bottomMarginLabel->setVisible(!isSingle);
+	formWidget->setVisible(!isSingle);
+
+	// we have to avoid that the single mode changes all other values if link button is checked
+	if (isSingle)
+		marginLinkButton->setChecked(false);
+
+	iconSetChange();
+	languageChange(); // update tooltips
+}
+
 void NewMarginWidget::setFacingPages(bool facing, int pageType)
 {
 	m_facingPages = facing;
 	m_pageType = pageType;
-
-	leftMarginLabel->setText( m_facingPages ? tr("Inside") : tr("Left"));
-	rightMarginLabel->setText( m_facingPages ? tr("Outside") : tr("Right"));
-
-	iconSetChange();
+
+	languageChange();
+	iconSetChange();
 	setPreset();
 }
 
Index: scribus/ui/newmarginwidget.h
===================================================================
--- scribus/ui/newmarginwidget.h	(Revision 26796)
+++ scribus/ui/newmarginwidget.h	(Arbeitskopie)
@@ -44,6 +44,9 @@
 		void setMarginPreset(int p);
 		int marginPreset() { return m_savedPresetItem; };
 		const MarginStruct & margins() const { return m_marginData; };
+		/*! \brief Switch 4 inputs to 1*/
+		void setSingleMode(bool isSingle);
+		bool isSingleMode() { return m_isSingle; };
 
 	public slots:
 		void languageChange();
@@ -66,6 +69,7 @@
 		MarginStruct m_savedMarginData;
 		QString m_pageSize;
 		bool   m_facingPages {false};
+		bool   m_isSingle {false};
 		double m_pageHeight {0.0};
 		double m_pageWidth {0.0};
 		double m_unitRatio {1.0};
Index: scribus/ui/newmarginwidgetbase.ui
===================================================================
--- scribus/ui/newmarginwidgetbase.ui	(Revision 26796)
+++ scribus/ui/newmarginwidgetbase.ui	(Arbeitskopie)
@@ -6,7 +6,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>164</width>
+    <width>168</width>
     <height>182</height>
    </rect>
   </property>
@@ -35,40 +35,6 @@
    <property name="verticalSpacing">
     <number>8</number>
    </property>
-   <item row="0" column="1" colspan="3">
-    <layout class="QHBoxLayout" name="horizontalLayout">
-     <item>
-      <widget class="QLabel" name="presetLayoutLabel">
-       <property name="text">
-        <string>Preset:</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="PresetLayout" name="presetLayoutComboBox">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="horizontalSpacer_5">
-       <property name="orientation">
-        <enum>Qt::Orientation::Horizontal</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>0</width>
-         <height>0</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
    <item row="1" column="2" rowspan="2">
     <widget class="FormWidget" name="formWidget">
      <property name="sizePolicy">
@@ -120,8 +86,8 @@
      </layout>
     </widget>
    </item>
-   <item row="1" column="1">
-    <widget class="FormWidget" name="leftMarginLabel">
+   <item row="1" column="3">
+    <widget class="FormWidget" name="rightMarginLabel">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
        <horstretch>0</horstretch>
@@ -129,7 +95,7 @@
       </sizepolicy>
      </property>
      <property name="label" stdset="0">
-      <string>Left</string>
+      <string>Right</string>
      </property>
      <property name="font">
       <font>
@@ -136,7 +102,7 @@
        <pointsize>8</pointsize>
       </font>
      </property>
-     <layout class="QHBoxLayout" name="horizontalLayout_5">
+     <layout class="QHBoxLayout" name="horizontalLayout_6">
       <property name="leftMargin">
        <number>0</number>
       </property>
@@ -150,7 +116,7 @@
        <number>0</number>
       </property>
       <item>
-       <widget class="ScrSpinBox" name="leftMarginSpinBox">
+       <widget class="ScrSpinBox" name="rightMarginSpinBox">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
           <horstretch>0</horstretch>
@@ -162,8 +128,8 @@
      </layout>
     </widget>
    </item>
-   <item row="2" column="1">
-    <widget class="FormWidget" name="topMarginLabel">
+   <item row="2" column="3">
+    <widget class="FormWidget" name="bottomMarginLabel">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
        <horstretch>0</horstretch>
@@ -171,7 +137,7 @@
       </sizepolicy>
      </property>
      <property name="label" stdset="0">
-      <string>Top</string>
+      <string>Bottom</string>
      </property>
      <property name="font">
       <font>
@@ -178,7 +144,7 @@
        <pointsize>8</pointsize>
       </font>
      </property>
-     <layout class="QHBoxLayout" name="horizontalLayout_3">
+     <layout class="QHBoxLayout" name="horizontalLayout_8">
       <property name="leftMargin">
        <number>0</number>
       </property>
@@ -192,7 +158,7 @@
        <number>0</number>
       </property>
       <item>
-       <widget class="ScrSpinBox" name="topMarginSpinBox">
+       <widget class="ScrSpinBox" name="bottomMarginSpinBox">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
           <horstretch>0</horstretch>
@@ -204,32 +170,8 @@
      </layout>
     </widget>
    </item>
-   <item row="4" column="1" colspan="3">
-    <layout class="QHBoxLayout" name="horizontalLayout_4">
-     <item>
-      <widget class="QPushButton" name="printerMarginsPushButton">
-       <property name="text">
-        <string>Printer Margins...</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="horizontalSpacer">
-       <property name="orientation">
-        <enum>Qt::Orientation::Horizontal</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>0</width>
-         <height>0</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
-   <item row="2" column="3">
-    <widget class="FormWidget" name="bottomMarginLabel">
+   <item row="1" column="1">
+    <widget class="FormWidget" name="leftMarginLabel">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
        <horstretch>0</horstretch>
@@ -237,7 +179,7 @@
       </sizepolicy>
      </property>
      <property name="label" stdset="0">
-      <string>Bottom</string>
+      <string>Left</string>
      </property>
      <property name="font">
       <font>
@@ -244,7 +186,7 @@
        <pointsize>8</pointsize>
       </font>
      </property>
-     <layout class="QHBoxLayout" name="horizontalLayout_8">
+     <layout class="QHBoxLayout" name="horizontalLayout_5">
       <property name="leftMargin">
        <number>0</number>
       </property>
@@ -258,7 +200,7 @@
        <number>0</number>
       </property>
       <item>
-       <widget class="ScrSpinBox" name="bottomMarginSpinBox">
+       <widget class="ScrSpinBox" name="leftMarginSpinBox">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
           <horstretch>0</horstretch>
@@ -270,8 +212,66 @@
      </layout>
     </widget>
    </item>
-   <item row="1" column="3">
-    <widget class="FormWidget" name="rightMarginLabel">
+   <item row="0" column="1" colspan="3">
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QLabel" name="presetLayoutLabel">
+       <property name="text">
+        <string>Preset:</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="PresetLayout" name="presetLayoutComboBox">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer_5">
+       <property name="orientation">
+        <enum>Qt::Orientation::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>0</width>
+         <height>0</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
+   </item>
+   <item row="4" column="1" colspan="3">
+    <layout class="QHBoxLayout" name="horizontalLayout_4">
+     <item>
+      <widget class="QPushButton" name="printerMarginsPushButton">
+       <property name="text">
+        <string>Printer Margins...</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Orientation::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>0</width>
+         <height>0</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
+   </item>
+   <item row="2" column="1">
+    <widget class="FormWidget" name="topMarginLabel">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
        <horstretch>0</horstretch>
@@ -279,7 +279,7 @@
       </sizepolicy>
      </property>
      <property name="label" stdset="0">
-      <string>Right</string>
+      <string>Top</string>
      </property>
      <property name="font">
       <font>
@@ -286,7 +286,7 @@
        <pointsize>8</pointsize>
       </font>
      </property>
-     <layout class="QHBoxLayout" name="horizontalLayout_6">
+     <layout class="QHBoxLayout" name="horizontalLayout_3">
       <property name="leftMargin">
        <number>0</number>
       </property>
@@ -300,7 +300,7 @@
        <number>0</number>
       </property>
       <item>
-       <widget class="ScrSpinBox" name="rightMarginSpinBox">
+       <widget class="ScrSpinBox" name="topMarginSpinBox">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
           <horstretch>0</horstretch>
@@ -312,6 +312,19 @@
      </layout>
     </widget>
    </item>
+   <item row="1" column="4">
+    <spacer name="horizontalSpacer_2">
+     <property name="orientation">
+      <enum>Qt::Orientation::Horizontal</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>0</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
   </layout>
  </widget>
  <customwidgets>
Index: scribus/ui/nodeeditpalette.cpp
===================================================================
--- scribus/ui/nodeeditpalette.cpp	(Revision 26796)
+++ scribus/ui/nodeeditpalette.cpp	(Arbeitskopie)
@@ -370,7 +370,7 @@
 		UndoManager::instance()->action(currItem, is);
 	}
 	//FIXME make an internal item copy poline to contourline member
-	currItem->ContourLine = currItem->PoLine.copy();
+	currItem->setContour(currItem->PoLine.copy());
 	currItem->ClipEdited = true;
 	m_doc->regionsChanged()->update(QRectF());
 	emit DocChanged();
@@ -382,7 +382,7 @@
 		return;
 
 	PageItem *currItem = m_doc->m_Selection->itemAt(0);
-	currItem->ContourLine = currItem->imageClip.copy();
+	currItem->setContour(currItem->imageClip.copy());
 	currItem->ClipEdited = true;
 	m_doc->regionsChanged()->update(QRectF());
 	emit DocChanged();
@@ -394,7 +394,7 @@
 		return;
 
 	PageItem *currItem = m_doc->m_Selection->itemAt(0);
-	currItem->PoLine = currItem->imageClip.copy();
+	currItem->setShape(currItem->imageClip.copy());
 	currItem->ClipEdited = true;
 	currItem->FrameType = 3;
 	m_doc->adjustItemSize(currItem);
@@ -796,9 +796,9 @@
 		// relative to the current position (in the item's coordinate space).
 		// adjustItemSize will then take care of moving the position and changing
 		// image offsets, etc.
-		currItem->PoLine = m_itemPath.copy();
+		currItem->setShape(m_itemPath.copy());
 		currItem->PoLine.translate(delta.x(), delta.y());
-		currItem->ContourLine = m_itemContourPath.copy();
+		currItem->setContour(m_itemContourPath.copy());
 		m_doc->adjustItemSize(currItem);
 		if (currItem->itemType() == PageItem::PathText)
 			currItem->updatePolyClip();
@@ -828,15 +828,15 @@
 	QPointF delta = m.map(QPointF(m_xPos, m_yPos)) - m.map(QPointF(currItem->xPos(), currItem->yPos()));
 	if (EditCont->isChecked())
 	{
-		currItem->ContourLine = m_itemContourPath.copy();
+		currItem->setContour(m_itemContourPath.copy());
 		currItem->ContourLine.translate(delta.x(), delta.y());
 	}
 	else
 	{
 		// See comment in NodePalette::CancelEdit
-		currItem->PoLine = m_itemPath;
+		currItem->setShape(m_itemPath);
  		currItem->PoLine.translate(delta.x(), delta.y());
- 		currItem->ContourLine = m_itemContourPath;
+		currItem->setContour(m_itemContourPath);
 		m_doc->adjustItemSize(currItem);
 	}
 	if (currItem->itemType() == PageItem::PathText)
Index: scribus/ui/propertiespalette.cpp
===================================================================
--- scribus/ui/propertiespalette.cpp	(Revision 26796)
+++ scribus/ui/propertiespalette.cpp	(Arbeitskopie)
@@ -243,11 +243,11 @@
 	handleSelectionChanged();
 }
 
-void PropertiesPalette::setTextFlowMode(PageItem::TextFlowMode mode)
+void PropertiesPalette::setTextFlowMode(PageItem::TextFlowMode mode, MarginStruct distances)
 {
 	if (!m_ScMW || m_ScMW->scriptIsRunning() || !m_haveItem)
 		return;
-	shapePal->showTextFlowMode(mode);
+	shapePal->showTextFlowMode(mode, distances);
 }
 
 PageItem* PropertiesPalette::currentItemFromSelection()
@@ -307,7 +307,7 @@
 	m_haveItem = false;
 	m_item = item;
 
-	setTextFlowMode(m_item->textFlowMode());
+	setTextFlowMode(m_item->textFlowMode(), m_item->textFlowMargins());
 
 //CB replaces old emits from PageItem::emitAllToGUI()
 	setLocked(item->locked());
Index: scribus/ui/propertiespalette.h
===================================================================
--- scribus/ui/propertiespalette.h	(Revision 26796)
+++ scribus/ui/propertiespalette.h	(Arbeitskopie)
@@ -62,7 +62,7 @@
 //	void updateColorSpecialGradient();
 	void updateColorList();
 	void setGradientEditMode(bool);
-	void setTextFlowMode(PageItem::TextFlowMode mode);
+	void setTextFlowMode(PageItem::TextFlowMode mode, MarginStruct distances);
 
 	/** @brief Returns true if there is a user action going on at the moment of call. */
 	bool userActionOn(); // not yet implemented!!! This is needed badly.
Index: scribus/ui/propertiespalette_line.cpp
===================================================================
--- scribus/ui/propertiespalette_line.cpp	(Revision 26796)
+++ scribus/ui/propertiespalette_line.cpp	(Arbeitskopie)
@@ -674,8 +674,11 @@
 		return;
 	bool setter = (c == 0);
 	m_doc->itemSelection_SetNamedLineStyle(setter ? QString("") : comboLineStyle->currentText());
+	m_doc->invalidateAll();
+	m_doc->regionsChanged()->update(QRect());
 
 	buttonLineStyleEdit->setEnabled(comboLineStyle->currentIndex() != 0);
+
 }
 
 void PropertiesPalette_Line::handleLineStyleNew()
@@ -757,7 +760,6 @@
 
 		m_item->setStrokeGradientExtend(buttonLineColor->gradientData().repeatMethod);
 		m_item->update();
-		m_doc->regionsChanged()->update(QRect());
 
 		break;
 	case Mode::Hatch:
@@ -782,9 +784,9 @@
 	}
 
 	m_doc->itemSelection_SetOverprint(buttonLineColor->generalData().overprint);
+	m_doc->invalidateAll();
+	m_doc->regionsChanged()->update(QRect());
 
-	//	m_item->update();
-	//	m_doc->regionsChanged()->update(QRect());
 	blockUpdates(false);
 
 }
Index: scribus/ui/propertiespalette_shape.cpp
===================================================================
--- scribus/ui/propertiespalette_shape.cpp	(Revision 26796)
+++ scribus/ui/propertiespalette_shape.cpp	(Arbeitskopie)
@@ -38,11 +38,18 @@
 	iconSetChange();
 	languageChange();
 
+	MarginStruct distances;
+	distances.resetToZero();
+
+	textFlowMargins->setup(distances, 0, m_unitIndex, NewMarginWidget::DistanceWidgetFlags);
+	textFlowMargins->toggleLabelVisibility(false);
+
 	connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange()));
 	connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange()));
 	connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool)));
 
 	connect(textFlowBtnGroup, SIGNAL(idClicked(int)), this, SLOT(handleTextFlow()));
+	connect(textFlowMargins, SIGNAL(valuesChanged(MarginStruct)), this, SLOT(handleTextFlow()));
 	connect(editShape, SIGNAL(clicked()) , this, SLOT(handleShapeEdit()));
 	connect(roundRect, SIGNAL(valueChanged(double)) , this, SLOT(handleCornerRadius()));
 	connect(customShape, SIGNAL(FormSel(int,int,qreal*)), this, SLOT(handleNewShape(int,int,qreal*)));
@@ -325,13 +332,12 @@
 		customShape->setIcon(customShape->getIconPixmap(m_item->FrameType-2));
 
 	roundRect->setValue(m_item->cornerRadius()*m_unitRatio);
-	showTextFlowMode(m_item->textFlowMode());
 	setLocked(m_item->locked());
 	setSizeLocked(m_item->sizeLocked());
 
 	// Frame type 3 is obsolete: CR 2005-02-06
 	//if (((i->itemType() == PageItem::TextFrame) || (i->itemType() == PageItem::ImageFrame) || (i->itemType() == 3)) &&  (!i->ClipEdited))
-	if (((m_item->isTextFrame()) || (m_item->isImageFrame())) &&  (!m_item->ClipEdited) && ((m_item->FrameType == 0) || (m_item->FrameType == 2)))
+	if ((m_item->isTextFrame() || m_item->isImageFrame()) &&  (!m_item->ClipEdited) && ((m_item->FrameType == 0) || (m_item->FrameType == 2)))
 		roundRect->setEnabled(true);
 	else
 	{
@@ -356,7 +362,8 @@
 		customShape->setEnabled(false);
 	}
 	m_haveItem = true;
-	showTextFlowMode(m_item->textFlowMode());
+
+	showTextFlowMode(m_item->textFlowMode(), m_item->textFlowMargins());
 }
 
 void PropertiesPalette_Shape::handleTextFlow()
@@ -364,17 +371,38 @@
 	PageItem::TextFlowMode mode = PageItem::TextFlowDisabled;
 	if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 		return;
+
 	if (textFlowDisabled->isChecked())
+	{
 		mode = PageItem::TextFlowDisabled;
-	if (textFlowUsesFrameShape->isChecked())
+		textFlowMargins->setVisible(false);
+	}
+	else if (textFlowUsesFrameShape->isChecked())
+	{
 		mode = PageItem::TextFlowUsesFrameShape;
-	if (textFlowUsesBoundingBox->isChecked())
+		textFlowMargins->setVisible(true);
+		textFlowMargins->setSingleMode(true);
+	}
+	else if (textFlowUsesBoundingBox->isChecked())
+	{
 		mode = PageItem::TextFlowUsesBoundingBox;
-	if (textFlowUsesContourLine->isChecked())
+		textFlowMargins->setVisible(true);
+		textFlowMargins->setSingleMode(false);
+	}
+	else if (textFlowUsesContourLine->isChecked())
+	{
 		mode = PageItem::TextFlowUsesContourLine;
-	if (textFlowUsesImageClipping->isChecked())
+		textFlowMargins->setVisible(true);
+		textFlowMargins->setSingleMode(true);
+	}
+	else if (textFlowUsesImageClipping->isChecked())
+	{
 		mode = PageItem::TextFlowUsesImageClipping;
-	m_item->setTextFlowMode(mode);
+		textFlowMargins->setVisible(true);
+		textFlowMargins->setSingleMode(true);
+	}
+
+	m_item->setTextFlowMode(mode, textFlowMargins->margins());
 	m_doc->changed();
 	m_doc->changedPagePreview();
 	m_doc->invalidateAll();
@@ -447,30 +475,57 @@
 	roundRect->blockSignals(b);
 	if (f == 0)
 		m_doc->setFrameRounded();
-	if ((m_item->itemType() == PageItem::ImageFrame) || (m_item->itemType() == PageItem::TextFrame))
-		return;
+	// if ((m_item->itemType() == PageItem::ImageFrame) || (m_item->itemType() == PageItem::TextFrame))
+	// 	return;
 	m_doc->invalidateAll();
 	m_doc->regionsChanged()->update(QRect());
 }
 
-void PropertiesPalette_Shape::showTextFlowMode(PageItem::TextFlowMode mode)
+void PropertiesPalette_Shape::showTextFlowMode(PageItem::TextFlowMode mode, MarginStruct distances)
 {
 	if (!m_ScMW || m_ScMW->scriptIsRunning() || !m_haveItem)
 		return;
+
+	QSignalBlocker textFlowMarginsBlocker(textFlowMargins);
+	textFlowMargins->setPageHeight(2000);
+	textFlowMargins->setPageWidth(2000);
+	textFlowMargins->setNewValues(distances);
+
 	if (mode == PageItem::TextFlowDisabled)
+	{
 		textFlowDisabled->setChecked(true);
+		textFlowMargins->setVisible(false);
+	}
 	else if (mode == PageItem::TextFlowUsesFrameShape)
+	{
 		textFlowUsesFrameShape->setChecked(true);
+		textFlowMargins->setVisible(true);
+		textFlowMargins->setSingleMode(true);
+	}
 	else if (mode == PageItem::TextFlowUsesBoundingBox)
+	{
 		textFlowUsesBoundingBox->setChecked(true);
+		textFlowMargins->setVisible(true);
+		textFlowMargins->setSingleMode(false);
+	}
 	else if (mode == PageItem::TextFlowUsesContourLine)
+	{
 		textFlowUsesContourLine->setChecked(true);
+		textFlowMargins->setVisible(true);
+		textFlowMargins->setSingleMode(true);
+	}
 	else if (mode == PageItem::TextFlowUsesImageClipping)
+	{
 		textFlowUsesImageClipping->setChecked(true);
+		textFlowMargins->setVisible(true);
+		textFlowMargins->setSingleMode(true);
+	}
+
 	if ((m_item->isImageFrame()) && (!m_item->imageClip.empty()))
 		textFlowUsesImageClipping->setEnabled(true);
 	else
 		textFlowUsesImageClipping->setEnabled(false);
+
 }
 
 void PropertiesPalette_Shape::iconSetChange()
@@ -501,9 +556,12 @@
 	m_unitRatio = m_doc->unitRatio();
 	m_unitIndex = m_doc->unitIndex();
 
-	roundRect->blockSignals(true);
+	QSignalBlocker roundRectBlocker(roundRect);
+	QSignalBlocker textFlowMarginBlocker(textFlowMargins);
+
 	roundRect->setNewUnit( m_unitIndex );
-	roundRect->blockSignals(false);
+	textFlowMargins->setNewUnit(m_unitIndex);
+
 }
 
 void PropertiesPalette_Shape::localeChange()
@@ -510,6 +568,7 @@
 {
 	const QLocale& l(LocaleManager::instance().userPreferredLocale());
 	roundRect->setLocale(l);
+	textFlowMargins->setLocale(l);
 }
 
 void PropertiesPalette_Shape::toggleLabelVisibility(bool v)
Index: scribus/ui/propertiespalette_shape.h
===================================================================
--- scribus/ui/propertiespalette_shape.h	(Revision 26796)
+++ scribus/ui/propertiespalette_shape.h	(Arbeitskopie)
@@ -35,7 +35,7 @@
 	void setLocked(bool isLocked);
 	void setSizeLocked(bool isLocked);
 	void setRoundRectEnabled(bool enabled);
-	void showTextFlowMode(PageItem::TextFlowMode mode);
+	void showTextFlowMode(PageItem::TextFlowMode mode, MarginStruct distances);
 
 protected:
 	bool m_haveDoc {false};
Index: scribus/ui/propertiespalette_shapebase.ui
===================================================================
--- scribus/ui/propertiespalette_shapebase.ui	(Revision 26796)
+++ scribus/ui/propertiespalette_shapebase.ui	(Arbeitskopie)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>238</width>
-    <height>107</height>
+    <height>117</height>
    </rect>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout">
@@ -54,10 +54,10 @@
      <item>
       <spacer name="horizontalSpacer">
        <property name="orientation">
-        <enum>Qt::Horizontal</enum>
+        <enum>Qt::Orientation::Horizontal</enum>
        </property>
        <property name="sizeType">
-        <enum>QSizePolicy::Fixed</enum>
+        <enum>QSizePolicy::Policy::Fixed</enum>
        </property>
        <property name="sizeHint" stdset="0">
         <size>
@@ -93,7 +93,7 @@
      <item>
       <spacer name="horizontalSpacer_2">
        <property name="orientation">
-        <enum>Qt::Horizontal</enum>
+        <enum>Qt::Orientation::Horizontal</enum>
        </property>
        <property name="sizeHint" stdset="0">
         <size>
@@ -148,7 +148,7 @@
            <bool>true</bool>
           </property>
           <property name="toolButtonStyle">
-           <enum>Qt::ToolButtonIconOnly</enum>
+           <enum>Qt::ToolButtonStyle::ToolButtonIconOnly</enum>
           </property>
           <attribute name="buttonGroup">
            <string notr="true">textFlowBtnGroup</string>
@@ -156,9 +156,9 @@
          </widget>
         </item>
         <item>
-         <widget class="QToolButton" name="textFlowUsesFrameShape">
+         <widget class="QToolButton" name="textFlowUsesBoundingBox">
           <property name="toolTip">
-           <string>Text flow around frame shape</string>
+           <string>Text flow around bounding box</string>
           </property>
           <property name="checkable">
            <bool>true</bool>
@@ -167,7 +167,7 @@
            <bool>true</bool>
           </property>
           <property name="toolButtonStyle">
-           <enum>Qt::ToolButtonIconOnly</enum>
+           <enum>Qt::ToolButtonStyle::ToolButtonIconOnly</enum>
           </property>
           <attribute name="buttonGroup">
            <string notr="true">textFlowBtnGroup</string>
@@ -175,9 +175,9 @@
          </widget>
         </item>
         <item>
-         <widget class="QToolButton" name="textFlowUsesBoundingBox">
+         <widget class="QToolButton" name="textFlowUsesFrameShape">
           <property name="toolTip">
-           <string>Text flow around bounding box</string>
+           <string>Text flow around frame shape</string>
           </property>
           <property name="checkable">
            <bool>true</bool>
@@ -186,7 +186,7 @@
            <bool>true</bool>
           </property>
           <property name="toolButtonStyle">
-           <enum>Qt::ToolButtonIconOnly</enum>
+           <enum>Qt::ToolButtonStyle::ToolButtonIconOnly</enum>
           </property>
           <attribute name="buttonGroup">
            <string notr="true">textFlowBtnGroup</string>
@@ -205,7 +205,7 @@
            <bool>true</bool>
           </property>
           <property name="toolButtonStyle">
-           <enum>Qt::ToolButtonIconOnly</enum>
+           <enum>Qt::ToolButtonStyle::ToolButtonIconOnly</enum>
           </property>
           <attribute name="buttonGroup">
            <string notr="true">textFlowBtnGroup</string>
@@ -224,7 +224,7 @@
            <bool>true</bool>
           </property>
           <property name="toolButtonStyle">
-           <enum>Qt::ToolButtonIconOnly</enum>
+           <enum>Qt::ToolButtonStyle::ToolButtonIconOnly</enum>
           </property>
           <attribute name="buttonGroup">
            <string notr="true">textFlowBtnGroup</string>
@@ -237,7 +237,7 @@
      <item>
       <spacer name="horizontalSpacer_4">
        <property name="orientation">
-        <enum>Qt::Horizontal</enum>
+        <enum>Qt::Orientation::Horizontal</enum>
        </property>
        <property name="sizeHint" stdset="0">
         <size>
@@ -250,9 +250,29 @@
     </layout>
    </item>
    <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_2">
+     <item>
+      <widget class="NewMarginWidget" name="textFlowMargins" native="true"/>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer_3">
+       <property name="orientation">
+        <enum>Qt::Orientation::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>0</width>
+         <height>0</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
+   </item>
+   <item>
     <spacer name="verticalSpacer">
      <property name="orientation">
-      <enum>Qt::Vertical</enum>
+      <enum>Qt::Orientation::Vertical</enum>
      </property>
      <property name="sizeHint" stdset="0">
       <size>
@@ -274,7 +294,7 @@
   <customwidget>
    <class>ScrSpinBox</class>
    <extends>QDoubleSpinBox</extends>
-   <header>ui/scrspinbox.h</header>
+   <header location="global">ui/scrspinbox.h</header>
   </customwidget>
   <customwidget>
    <class>Autoforms</class>
@@ -281,6 +301,12 @@
    <extends>QToolButton</extends>
    <header>ui/autoform.h</header>
   </customwidget>
+  <customwidget>
+   <class>NewMarginWidget</class>
+   <extends>QWidget</extends>
+   <header>ui/newmarginwidget.h</header>
+   <container>1</container>
+  </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
