r16990 by fschmid - Fixed Bug 9974: "Not possible: Display Page Borders in Foreground and Display Page grid in Background."

scribus-commit scribus-commit at lists.scribus.net
Sat Nov 19 22:43:33 UTC 2011


Author: fschmid
Date: Sat Nov 19 22:43:33 2011
New Revision: 16990

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16990
Log:
Fixed Bug 9974: "Not possible: Display Page Borders in Foreground and Display Page grid in Background."

Modified:
    trunk/Scribus/scribus/canvas.cpp
    trunk/Scribus/scribus/canvas.h
    trunk/Scribus/scribus/canvasmode_normal.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
    trunk/Scribus/scribus/prefsmanager.cpp
    trunk/Scribus/scribus/prefsstructs.h
    trunk/Scribus/scribus/ui/prefs_guides.cpp
    trunk/Scribus/scribus/ui/prefs_guides.h
    trunk/Scribus/scribus/ui/prefs_guidesbase.ui

Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16990&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp (original)
+++ trunk/Scribus/scribus/canvas.cpp Sat Nov 19 22:43:33 2011
@@ -981,12 +981,10 @@
 	ScLayer layer;
 	layer.isViewable = false;
 	layer.ID = 0;
-	
-//	Tsetup = tim.elapsed();
+
 	if (!m_doc->masterPageMode())
 	{
 		drawBackgroundPageOutlines(painter, clipx, clipy, clipw, cliph);
-//		Toutlines= tim.elapsed();
 		if (m_viewMode.viewAsPreview)
 		{
 			FPointArray PoLine;
@@ -997,51 +995,90 @@
 			painter->beginLayer(1.0, 0);
 		
 		m_viewMode.linkedFramesToShow.clear();
-		if ((m_doc->guidesPrefs().guidePlacement) && (!m_viewMode.viewAsPreview))
-		{
-			drawGuides(painter, clipx, clipy, clipw, cliph);
-		}
-		int layerCount = m_doc->layerCount();
-		for (int layerLevel = 0; layerLevel < layerCount; ++layerLevel)
-		{
-			m_doc->Layers.levelToLayer(layer, layerLevel);
-			for (uint a = 0; a < docPagesCount; ++a)
-			{
-				DrawMasterItems(painter, m_doc->Pages->at(a), layer, QRect(clipx, clipy, clipw, cliph));
-			}
-			DrawPageItems(painter, layer, QRect(clipx, clipy, clipw, cliph));
-		}
+		QRectF clip = QRectF(clipx, clipy, clipw, cliph);
+		if (!m_viewMode.viewAsPreview)
+			DrawPageBorder(painter, clip);
+		int renderStackCount = m_doc->guidesPrefs().renderStackOrder.count();
+		for (int r = 0; r < renderStackCount; r++)
+		{
+			int ri = m_doc->guidesPrefs().renderStackOrder[r];
+			if (ri == 0)
+			{
+				if (!m_viewMode.viewAsPreview)
+					DrawPageMargins(painter, clip);			// drawing stack id = 0
+			}
+			else if (ri == 1)
+			{
+				if (!m_viewMode.viewAsPreview)
+					DrawPageBaselineGrid(painter, clip);	// drawing stack id = 1
+			}
+			else if (ri == 2)
+			{
+				if (!m_viewMode.viewAsPreview)
+					DrawPageGrid(painter, clip);			// drawing stack id = 2
+			}
+			else if (ri == 3)
+			{
+				if (!m_viewMode.viewAsPreview)
+					DrawPageGuides(painter, clip);			// drawing stack id = 3
+			}
+			else if (ri == 4)
+			{
+				int layerCount = m_doc->layerCount();	// drawing stack id = 4
+				for (int layerLevel = 0; layerLevel < layerCount; ++layerLevel)
+				{
+					m_doc->Layers.levelToLayer(layer, layerLevel);
+					for (uint a = 0; a < docPagesCount; ++a)
+					{
+						DrawMasterItems(painter, m_doc->Pages->at(a), layer, QRect(clipx, clipy, clipw, cliph));
+					}
+					DrawPageItems(painter, layer, QRect(clipx, clipy, clipw, cliph));
+				}
+			}
+		}
+		if (!m_viewMode.viewAsPreview)
+			DrawPageIndicator(painter, clip);
 		painter->endLayer();
-//		Tcontents = tim.elapsed();
-		if ((!m_doc->guidesPrefs().guidePlacement) && (!m_viewMode.viewAsPreview))
-		{
-			drawGuides(painter, clipx, clipy, clipw, cliph);
-		}
 	}
 	else // masterPageMode
 	{			
 		m_viewMode.linkedFramesToShow.clear();
 		drawBackgroundMasterpage(painter, clipx, clipy, clipw, cliph);
-		
-//		Tbackground = tim.elapsed();
 		painter->beginLayer(1.0, 0);
-		int layerCount = m_doc->layerCount();
-		for (int layerLevel = 0; layerLevel < layerCount; ++layerLevel)
-		{
-			m_doc->Layers.levelToLayer(layer, layerLevel);
-			DrawPageItems(painter, layer, QRect(clipx, clipy, clipw, cliph));
-		}
+		QRectF clip = QRectF(clipx, clipy, clipw, cliph);
+		DrawPageBorder(painter, clip, true);
+		int renderStackCount = m_doc->guidesPrefs().renderStackOrder.count();
+		for (int r = 0; r < renderStackCount; r++)
+		{
+			int ri = m_doc->guidesPrefs().renderStackOrder[r];
+			if (ri == 0)
+			{
+				DrawPageMargins(painter, clip, true);			// drawing stack id = 0
+			}
+			else if (ri == 1)
+			{
+				DrawPageBaselineGrid(painter, clip, true);	// drawing stack id = 1
+			}
+			else if (ri == 2)
+			{
+				DrawPageGrid(painter, clip, true);			// drawing stack id = 2
+			}
+			else if (ri == 3)
+			{
+				DrawPageGuides(painter, clip, true);			// drawing stack id = 3
+			}
+			else if (ri == 4)
+			{
+				int layerCount = m_doc->layerCount();	// drawing stack id = 4
+				for (int layerLevel = 0; layerLevel < layerCount; ++layerLevel)
+				{
+					m_doc->Layers.levelToLayer(layer, layerLevel);
+					DrawPageItems(painter, layer, QRect(clipx, clipy, clipw, cliph));
+				}
+			}
+		}
+		DrawPageIndicator(painter, clip, true);
 		painter->endLayer();
-//		Tcontents = tim.elapsed();
-		
-		double x = m_doc->scratch()->Left * m_viewMode.scale;
-		double y = m_doc->scratch()->Top * m_viewMode.scale;
-		double w = m_doc->currentPage()->width() * m_viewMode.scale;
-		double h = m_doc->currentPage()->height() * m_viewMode.scale;
-		QRectF drawRect = QRectF(x, y, w+5, h+5);
-		drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
-		if ((!m_doc->guidesPrefs().guidePlacement) && (drawRect.intersects(QRect(clipx, clipy, clipw, cliph))))
-			DrawPageMarks(painter, m_doc->currentPage(), QRect(clipx, clipy, clipw, cliph));
 	}
 	if (((m_doc->m_Selection->count() != 0) || (m_viewMode.linkedFramesToShow.count() != 0))  && (!m_viewMode.viewAsPreview))
 	{
@@ -1603,12 +1640,10 @@
 		painter->setBrush(QColor(128,128,128));
 		MarginStruct pageBleeds;
 		m_doc->getBleeds(m_doc->currentPage(), pageBleeds);
-//		painter->beginLayer(1.0, 0);
 		painter->setAntialiasing(false);
 		painter->setPen(Qt::black, 1 / m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 		if (m_doc->bleeds()->hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
 		{
-//			painter->drawRect(m_doc->scratch.Left - bleedLeft+5 / m_viewMode.scale, m_doc->scratch.Top - bleedTop+5 / m_viewMode.scale, m_doc->currentPage()->width() + bleedLeft + bleedRight, m_doc->currentPage()->height() + bleedBottom + bleedTop);
 			if (PrefsManager::instance()->appPrefs.displayPrefs.showPageShadow)
 				painter->drawRect(m_doc->scratch()->Left - pageBleeds.Left+5, m_doc->scratch()->Top - pageBleeds.Top+5, m_doc->currentPage()->width() + pageBleeds.Left + pageBleeds.Right, m_doc->currentPage()->height() + pageBleeds.Bottom + pageBleeds.Top);
 			painter->setBrush(m_doc->paperColor());
@@ -1616,16 +1651,12 @@
 		}
 		else
 		{
-//			painter->drawRect(m_doc->scratch.Left+5 / m_viewMode.scale, m_doc->scratch.Top+5 / m_viewMode.scale, m_doc->currentPage()->width(), m_doc->currentPage()->height());
 			if (PrefsManager::instance()->appPrefs.displayPrefs.showPageShadow)
 				painter->drawRect(m_doc->scratch()->Left+5, m_doc->scratch()->Top+5, m_doc->currentPage()->width(), m_doc->currentPage()->height());
 			painter->setBrush(m_doc->paperColor());
 			painter->drawRect(m_doc->scratch()->Left, m_doc->scratch()->Top, m_doc->currentPage()->width(), m_doc->currentPage()->height());
 		}
 		painter->setAntialiasing(true);
-		if (m_doc->guidesPrefs().guidePlacement)
-			DrawPageMarks(painter, m_doc->currentPage(), QRect(clipx, clipy, clipw, cliph));
-//		painter->endLayer();
 	}
 }
 
@@ -1636,13 +1667,11 @@
  */
 void Canvas::drawBackgroundPageOutlines(ScPainter* painter, int clipx, int clipy, int clipw, int cliph)
 {
-// 	qDebug()<<"Canvas::drawBackgroundPageOutlines"<< clipx<< clipy<< clipw<<cliph;
 	uint docPagesCount=m_doc->Pages->count();
 	if (PrefsManager::instance()->appPrefs.displayPrefs.showPageShadow && !m_viewMode.viewAsPreview)
 	{
 		painter->setBrush(QColor(128,128,128));
 		painter->setAntialiasing(false);
-//		painter->beginLayer(1.0, 0);
 		painter->setPen(Qt::black, 1.0 / m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 		ScPage *actPg;
 		MarginStruct pageBleeds;
@@ -1671,7 +1700,6 @@
 					blw2 += pageBleeds.Left + pageBleeds.Right;
 					blh2 += pageBleeds.Bottom + pageBleeds.Top;
 				}
-//				painter->drawRect(blx2 + 5 /* m_viewMode.scale */, bly2 + 5 /* m_viewMode.scale */, blw2, blh2);
 				painter->drawRect(blx2 + 5, bly2 + 5, blw2, blh2);
 				if (m_doc->bleeds()->hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
 				{
@@ -1681,7 +1709,6 @@
 				}
 			}
 		}
-//		painter->endLayer();
 		painter->setAntialiasing(true);
 	}
 	painter->setFillMode(ScPainter::Solid);
@@ -1714,7 +1741,6 @@
 			painter->setFillMode(ScPainter::Solid);
 			painter->setPen(Qt::black, 0, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 			painter->setAntialiasing(false);
-//			painter->beginLayer(1.0, 0);
 			painter->setLineWidth(0.0);
 			painter->setBrush(m_doc->paperColor());
 			if (!m_viewMode.viewAsPreview)
@@ -1729,7 +1755,6 @@
 			}
 			else
 				painter->drawRect(x, y, w, h);
-//			painter->endLayer();
 			painter->setAntialiasing(true);
 		}
 	}
@@ -1765,125 +1790,522 @@
 	}
 }
 
-
-void Canvas::drawGuides(ScPainter* painter, int clipx, int clipy, int clipw, int cliph)
-{
-	uint docPagesCount=m_doc->Pages->count();
-	ScPage *actPg;
-	for (uint a = 0; a < docPagesCount; ++a)
-	{
-		actPg = m_doc->Pages->at(a);
-		double x = actPg->xOffset() * m_viewMode.scale;
-		double y = actPg->yOffset() * m_viewMode.scale;
-		double w = actPg->width() * m_viewMode.scale;
-		double h = actPg->height() * m_viewMode.scale;
+/**
+  draws page border
+  */
+void Canvas::DrawPageBorder(ScPainter *p, QRectF clip, bool master)
+{
+	if (master)
+	{
+		ScPage *page = m_doc->currentPage();
+		double x = m_doc->scratch()->Left * m_viewMode.scale;
+		double y = m_doc->scratch()->Top * m_viewMode.scale;
+		double w = page->width() * m_viewMode.scale;
+		double h = page->height() * m_viewMode.scale;
 		QRectF drawRect = QRectF(x, y, w+5, h+5);
 		drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
-		if (drawRect.intersects(QRectF(clipx, clipy, clipw, cliph)))
-			DrawPageMarks(painter, m_doc->Pages->at(a), QRect(clipx, clipy, clipw, cliph));
-	}				
-}
-
+		if (drawRect.intersects(clip))
+		{
+			p->save();
+			p->setAntialiasing(false);
+			p->translate(page->xOffset(), page->yOffset());
+			double lineWidth = 1.0 / m_viewMode.scale;
+			double pageHeight = page->height();
+			double pageWidth = page->width();
+			p->setFillMode(ScPainter::None);
+			p->setStrokeMode(ScPainter::Solid);
+			p->setPen(Qt::black, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+			p->drawRect(0, 0, pageWidth, pageHeight);
+			p->setAntialiasing(true);
+			p->restore();
+		}
+	}
+	else
+	{
+		uint docPagesCount = m_doc->Pages->count();
+		for (uint a = 0; a < docPagesCount; ++a)
+		{
+			ScPage *page = m_doc->Pages->at(a);
+			QRectF drawRect = QRectF(page->xOffset() * m_viewMode.scale, page->yOffset() * m_viewMode.scale, page->width() * m_viewMode.scale + 5, page->height() * m_viewMode.scale + 5);
+			drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+			if (drawRect.intersects(clip))
+			{
+				p->save();
+				p->setAntialiasing(false);
+				p->translate(page->xOffset(), page->yOffset());
+				double lineWidth = 1.0 / m_viewMode.scale;
+				double pageHeight = page->height();
+				double pageWidth = page->width();
+				p->setFillMode(ScPainter::None);
+				p->setStrokeMode(ScPainter::Solid);
+				p->setPen(Qt::black, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+				p->drawRect(0, 0, pageWidth, pageHeight);
+				p->setAntialiasing(true);
+				p->restore();
+			}
+		}
+	}
+}
 
 /**
-  draws guides, margins, grid and baseline grid
+  draws margins
  */
-void Canvas::DrawPageMarks(ScPainter *p, ScPage *page, QRect clip)
-{
-	p->save();
-	p->setAntialiasing(false);
-	p->translate(page->xOffset(), page->yOffset());
-	double lineWidth = 1.0 / m_viewMode.scale;
-	double pageHeight=page->height();
-	double pageWidth=page->width();
-	p->setFillMode(ScPainter::None);
-	p->setStrokeMode(ScPainter::Solid);
-
-	p->setPen(Qt::black, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-	p->drawRect(0, 0, pageWidth, pageHeight);
-	//Draw the margins
-	if (m_doc->guidesPrefs().marginsShown)
-	{
-		p->setPen(m_doc->guidesPrefs().marginColor);
-		if (m_doc->marginColored())
-		{
-			p->setFillMode(ScPainter::Solid);
-			p->setBrush(m_doc->guidesPrefs().marginColor);
-			p->drawRect(0, 0, pageWidth, page->Margins.Top);
-			p->drawRect(0, page->Margins.Top, page->Margins.Left, pageHeight - page->Margins.Top);
-			p->drawRect(page->Margins.Left, pageHeight - page->Margins.Bottom, pageWidth - page->Margins.Right - page->Margins.Left, page->Margins.Bottom);
-			p->drawRect(pageWidth - page->Margins.Right, page->Margins.Top, page->Margins.Right, pageHeight-page->Margins.Top);
+void Canvas::DrawPageMargins(ScPainter *p, QRectF clip, bool master)
+{
+	if (master)
+	{
+		ScPage *page = m_doc->currentPage();
+		double x = m_doc->scratch()->Left * m_viewMode.scale;
+		double y = m_doc->scratch()->Top * m_viewMode.scale;
+		double w = page->width() * m_viewMode.scale;
+		double h = page->height() * m_viewMode.scale;
+		QRectF drawRect = QRectF(x, y, w+5, h+5);
+		drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+		if (drawRect.intersects(clip))
+		{
+			p->save();
+			p->setAntialiasing(false);
+			p->translate(page->xOffset(), page->yOffset());
+			double lineWidth = 1.0 / m_viewMode.scale;
+			double pageHeight = page->height();
+			double pageWidth = page->width();
 			p->setFillMode(ScPainter::None);
-		}
-//		p->setPen(m_doc->guidesPrefs().margColor);
-		p->setFillMode(ScPainter::None);
-		p->drawRect(page->Margins.Left, page->Margins.Top, pageWidth - page->Margins.Left - page->Margins.Right, pageHeight - page->Margins.Top - page->Margins.Bottom);
-//		p->drawLine(FPoint(0, page->Margins.Top), FPoint(pageWidth, page->Margins.Top));
-//		p->drawLine(FPoint(0, pageHeight - page->Margins.Bottom), FPoint(pageWidth, pageHeight - page->Margins.Bottom));
-//		p->drawLine(FPoint(page->Margins.Left, 0), FPoint(page->Margins.Left, pageHeight));
-//		p->drawLine(FPoint(pageWidth - page->Margins.Right, 0), FPoint(pageWidth - page->Margins.Right, pageHeight));
-	}
-	//Draw the baseline grid
-	if (m_doc->guidesPrefs().baselineGridShown)
-	{
-		p->setPen(m_doc->guidesPrefs().baselineGridColor, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-		for (double yg = m_doc->guidesPrefs().offsetBaselineGrid; yg < pageHeight; yg += m_doc->guidesPrefs().valueBaselineGrid)
-			p->drawLine(FPoint(0, yg), FPoint(pageWidth, yg));
-	}
-	//Draw the grid lines
-	if (m_doc->guidesPrefs().gridShown)
-	{
-		double lowerBx = qMax(clip.x() / m_viewMode.scale + m_doc->minCanvasCoordinate.x() - page->xOffset(), 0.0);
-		double lowerBy = qMax(clip.y() / m_viewMode.scale + m_doc->minCanvasCoordinate.y() - page->yOffset(), 0.0);
-		double highBx = qMin(lowerBx + clip.width() / m_viewMode.scale, pageWidth);
-		double highBy = qMin(lowerBy + clip.height() / m_viewMode.scale, pageHeight);
-		if (m_viewMode.scale > 0.49)
-		{
-			double i,start;
-			i = m_doc->guidesPrefs().majorGridSpacing;
-			p->setPen(m_doc->guidesPrefs().majorGridColor, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-			start=floor(lowerBy/i);
-			start*=i;
-			for (double b = start; b <= highBy; b+=i)
-			{
-				p->drawLine(FPoint(qMax(lowerBx, 0.0), b), FPoint(qMin(pageWidth, highBx), b));
-			}
-			start=floor(lowerBx/i);
-			start*=i;
-			for (double b = start; b <= highBx; b+=i)
-			{
-				p->drawLine(FPoint(b, qMax(lowerBy, 0.0)), FPoint(b, qMin(pageHeight, highBy)));
-			}
-			i = m_doc->guidesPrefs().minorGridSpacing;
-			p->setPen(m_doc->guidesPrefs().minorGridColor, lineWidth, Qt::DotLine, Qt::FlatCap, Qt::MiterJoin);
-			start=floor(lowerBy/i);
-			start*=i;
-			for (double b = start; b <= highBy; b+=i)
-			{
-				p->drawLine(FPoint(qMax(lowerBx, 0.0), b), FPoint(qMin(pageWidth, highBx), b));
-			}
-			start=floor(lowerBx/i);
-			start*=i;
-			for (double b = start; b <= highBx; b+=i)
-			{
-				p->drawLine(FPoint(b, qMax(lowerBy, 0.0)), FPoint(b, qMin(pageHeight, highBy)));
-			}
-		}
-	}
-	//Draw the guides
-	if (m_doc->guidesPrefs().guidesShown)
-		page->guides.drawPage(p, m_doc, lineWidth);
-	if (m_doc->currentPage() == page)
-	{
-		p->setPen(PrefsManager::instance()->appPrefs.displayPrefs.pageBorderColor, 1 / m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-		p->drawRect(0, 0, pageWidth, pageHeight);
-	}
-	p->setAntialiasing(true);
-
-	p->restore();
-}
-
-
+			p->setStrokeMode(ScPainter::Solid);
+			p->setPen(Qt::black, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+			if (m_doc->guidesPrefs().marginsShown)
+			{
+				p->setPen(m_doc->guidesPrefs().marginColor);
+				if (m_doc->marginColored())
+				{
+					p->setFillMode(ScPainter::Solid);
+					p->setBrush(m_doc->guidesPrefs().marginColor);
+					p->drawRect(0, 0, pageWidth, page->Margins.Top);
+					p->drawRect(0, page->Margins.Top, page->Margins.Left, pageHeight - page->Margins.Top);
+					p->drawRect(page->Margins.Left, pageHeight - page->Margins.Bottom, pageWidth - page->Margins.Right - page->Margins.Left, page->Margins.Bottom);
+					p->drawRect(pageWidth - page->Margins.Right, page->Margins.Top, page->Margins.Right, pageHeight-page->Margins.Top);
+					p->setFillMode(ScPainter::None);
+				}
+				p->setFillMode(ScPainter::None);
+				p->drawRect(page->Margins.Left, page->Margins.Top, pageWidth - page->Margins.Left - page->Margins.Right, pageHeight - page->Margins.Top - page->Margins.Bottom);
+			}
+			p->setAntialiasing(true);
+			p->restore();
+		}
+	}
+	else
+	{
+		uint docPagesCount = m_doc->Pages->count();
+		for (uint a = 0; a < docPagesCount; ++a)
+		{
+			ScPage *page = m_doc->Pages->at(a);
+			QRectF drawRect = QRectF(page->xOffset() * m_viewMode.scale, page->yOffset() * m_viewMode.scale, page->width() * m_viewMode.scale + 5, page->height() * m_viewMode.scale + 5);
+			drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+			if (drawRect.intersects(clip))
+			{
+				p->save();
+				p->setAntialiasing(false);
+				p->translate(page->xOffset(), page->yOffset());
+				double lineWidth = 1.0 / m_viewMode.scale;
+				double pageHeight = page->height();
+				double pageWidth = page->width();
+				p->setFillMode(ScPainter::None);
+				p->setStrokeMode(ScPainter::Solid);
+				p->setPen(Qt::black, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+				if (m_doc->guidesPrefs().marginsShown)
+				{
+					p->setPen(m_doc->guidesPrefs().marginColor);
+					if (m_doc->marginColored())
+					{
+						p->setFillMode(ScPainter::Solid);
+						p->setBrush(m_doc->guidesPrefs().marginColor);
+						p->drawRect(0, 0, pageWidth, page->Margins.Top);
+						p->drawRect(0, page->Margins.Top, page->Margins.Left, pageHeight - page->Margins.Top);
+						p->drawRect(page->Margins.Left, pageHeight - page->Margins.Bottom, pageWidth - page->Margins.Right - page->Margins.Left, page->Margins.Bottom);
+						p->drawRect(pageWidth - page->Margins.Right, page->Margins.Top, page->Margins.Right, pageHeight-page->Margins.Top);
+						p->setFillMode(ScPainter::None);
+					}
+					p->setFillMode(ScPainter::None);
+					p->drawRect(page->Margins.Left, page->Margins.Top, pageWidth - page->Margins.Left - page->Margins.Right, pageHeight - page->Margins.Top - page->Margins.Bottom);
+				}
+				p->setAntialiasing(true);
+				p->restore();
+			}
+		}
+	}
+}
+
+/**
+  draws baseline grid
+ */
+void Canvas::DrawPageBaselineGrid(ScPainter *p, QRectF clip, bool master)
+{
+	if (master)
+	{
+		ScPage *page = m_doc->currentPage();
+		double x = m_doc->scratch()->Left * m_viewMode.scale;
+		double y = m_doc->scratch()->Top * m_viewMode.scale;
+		double w = page->width() * m_viewMode.scale;
+		double h = page->height() * m_viewMode.scale;
+		QRectF drawRect = QRectF(x, y, w+5, h+5);
+		drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+		if (drawRect.intersects(clip))
+		{
+			p->save();
+			p->setAntialiasing(false);
+			p->translate(page->xOffset(), page->yOffset());
+			double lineWidth = 1.0 / m_viewMode.scale;
+			double pageHeight = page->height();
+			double pageWidth = page->width();
+			p->setFillMode(ScPainter::None);
+			p->setStrokeMode(ScPainter::Solid);
+			p->setPen(Qt::black, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+			if (m_doc->guidesPrefs().baselineGridShown)
+			{
+				p->setPen(m_doc->guidesPrefs().baselineGridColor, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+				for (double yg = m_doc->guidesPrefs().offsetBaselineGrid; yg < pageHeight; yg += m_doc->guidesPrefs().valueBaselineGrid)
+					p->drawLine(FPoint(0, yg), FPoint(pageWidth, yg));
+			}
+			p->setAntialiasing(true);
+			p->restore();
+		}
+	}
+	else
+	{
+		uint docPagesCount = m_doc->Pages->count();
+		for (uint a = 0; a < docPagesCount; ++a)
+		{
+			ScPage *page = m_doc->Pages->at(a);
+			QRectF drawRect = QRectF(page->xOffset() * m_viewMode.scale, page->yOffset() * m_viewMode.scale, page->width() * m_viewMode.scale + 5, page->height() * m_viewMode.scale + 5);
+			drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+			if (drawRect.intersects(clip))
+			{
+				p->save();
+				p->setAntialiasing(false);
+				p->translate(page->xOffset(), page->yOffset());
+				double lineWidth = 1.0 / m_viewMode.scale;
+				double pageHeight = page->height();
+				double pageWidth = page->width();
+				p->setFillMode(ScPainter::None);
+				p->setStrokeMode(ScPainter::Solid);
+				p->setPen(Qt::black, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+				if (m_doc->guidesPrefs().baselineGridShown)
+				{
+					p->setPen(m_doc->guidesPrefs().baselineGridColor, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+					for (double yg = m_doc->guidesPrefs().offsetBaselineGrid; yg < pageHeight; yg += m_doc->guidesPrefs().valueBaselineGrid)
+						p->drawLine(FPoint(0, yg), FPoint(pageWidth, yg));
+				}
+				p->setAntialiasing(true);
+				p->restore();
+			}
+		}
+	}
+}
+
+/**
+  draws grid
+ */
+void Canvas::DrawPageGrid(ScPainter *p, QRectF clip, bool master)
+{
+	if (master)
+	{
+		ScPage *page = m_doc->currentPage();
+		double x = m_doc->scratch()->Left * m_viewMode.scale;
+		double y = m_doc->scratch()->Top * m_viewMode.scale;
+		double w = page->width() * m_viewMode.scale;
+		double h = page->height() * m_viewMode.scale;
+		QRectF drawRect = QRectF(x, y, w+5, h+5);
+		drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+		if (drawRect.intersects(clip))
+		{
+			p->save();
+			p->setAntialiasing(false);
+			p->translate(page->xOffset(), page->yOffset());
+			double lineWidth = 1.0 / m_viewMode.scale;
+			double pageHeight = page->height();
+			double pageWidth = page->width();
+			p->setFillMode(ScPainter::None);
+			p->setStrokeMode(ScPainter::Solid);
+			p->setPen(Qt::black, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+			if (m_doc->guidesPrefs().gridShown)
+			{
+				double lowerBx = qMax(clip.x() / m_viewMode.scale + m_doc->minCanvasCoordinate.x() - page->xOffset(), 0.0);
+				double lowerBy = qMax(clip.y() / m_viewMode.scale + m_doc->minCanvasCoordinate.y() - page->yOffset(), 0.0);
+				double highBx = qMin(lowerBx + clip.width() / m_viewMode.scale, pageWidth);
+				double highBy = qMin(lowerBy + clip.height() / m_viewMode.scale, pageHeight);
+				if (m_viewMode.scale > 0.49)
+				{
+				/*	double i, startX, startY;
+					i = m_doc->guidesPrefs().minorGridSpacing;
+					p->setPen(m_doc->guidesPrefs().minorGridColor, 3.0 / m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin);
+					startY = floor(lowerBy / i);
+					startY *= i;
+					startX = floor(lowerBx / i);
+					startX *= i;
+					for (double b = startY; b <= highBy; b += i)
+					{
+						for (double bb = startX; bb <= highBx; bb += i)
+						{
+							p->drawLine(FPoint(bb, b), FPoint(bb, b));
+						}
+					}
+					i = m_doc->guidesPrefs().majorGridSpacing;
+					p->setPen(m_doc->guidesPrefs().minorGridColor, lineWidth * 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+					startY = floor(lowerBy / i);
+					startY *= i;
+					startX = floor(lowerBx / i);
+					startX *= i;
+					for (double b = startY; b <= highBy; b += i)
+					{
+						for (double bb = startX; bb <= highBx; bb += i)
+						{
+							p->drawLine(FPoint(bb - 4, b), FPoint(bb + 4, b));
+							p->drawLine(FPoint(bb, b - 4), FPoint(bb, b + 4));
+						}
+					} */
+					double i,start;
+					i = m_doc->guidesPrefs().majorGridSpacing;
+					p->setPen(m_doc->guidesPrefs().majorGridColor, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+					start = floor(lowerBy / i);
+					start *= i;
+					for (double b = start; b <= highBy; b+=i)
+					{
+						p->drawLine(FPoint(qMax(lowerBx, 0.0), b), FPoint(qMin(pageWidth, highBx), b));
+					}
+					start=floor(lowerBx/i);
+					start*=i;
+					for (double b = start; b <= highBx; b+=i)
+					{
+						p->drawLine(FPoint(b, qMax(lowerBy, 0.0)), FPoint(b, qMin(pageHeight, highBy)));
+					}
+					i = m_doc->guidesPrefs().minorGridSpacing;
+					p->setPen(m_doc->guidesPrefs().minorGridColor, lineWidth, Qt::DotLine, Qt::FlatCap, Qt::MiterJoin);
+					start = floor(lowerBy / i);
+					start *= i;
+					for (double b = start; b <= highBy; b+=i)
+					{
+						p->drawLine(FPoint(qMax(lowerBx, 0.0), b), FPoint(qMin(pageWidth, highBx), b));
+					}
+					start=floor(lowerBx/i);
+					start*=i;
+					for (double b = start; b <= highBx; b+=i)
+					{
+						p->drawLine(FPoint(b, qMax(lowerBy, 0.0)), FPoint(b, qMin(pageHeight, highBy)));
+					}
+				}
+			}
+			p->setAntialiasing(true);
+			p->restore();
+		}
+	}
+	else
+	{
+		uint docPagesCount = m_doc->Pages->count();
+		for (uint a = 0; a < docPagesCount; ++a)
+		{
+			ScPage *page = m_doc->Pages->at(a);
+			QRectF drawRect = QRectF(page->xOffset() * m_viewMode.scale, page->yOffset() * m_viewMode.scale, page->width() * m_viewMode.scale + 5, page->height() * m_viewMode.scale + 5);
+			drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+			if (drawRect.intersects(clip))
+			{
+				p->save();
+				p->setAntialiasing(false);
+				p->translate(page->xOffset(), page->yOffset());
+				double lineWidth = 1.0 / m_viewMode.scale;
+				double pageHeight = page->height();
+				double pageWidth = page->width();
+				p->setFillMode(ScPainter::None);
+				p->setStrokeMode(ScPainter::Solid);
+				p->setPen(Qt::black, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+				if (m_doc->guidesPrefs().gridShown)
+				{
+					double lowerBx = qMax(clip.x() / m_viewMode.scale + m_doc->minCanvasCoordinate.x() - page->xOffset(), 0.0);
+					double lowerBy = qMax(clip.y() / m_viewMode.scale + m_doc->minCanvasCoordinate.y() - page->yOffset(), 0.0);
+					double highBx = qMin(lowerBx + clip.width() / m_viewMode.scale, pageWidth);
+					double highBy = qMin(lowerBy + clip.height() / m_viewMode.scale, pageHeight);
+					if (m_viewMode.scale > 0.49)
+					{
+					/*	double i, startX, startY;
+						i = m_doc->guidesPrefs().minorGridSpacing;
+						p->setPen(m_doc->guidesPrefs().minorGridColor, 3.0 / m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin);
+						startY = floor(lowerBy / i);
+						startY *= i;
+						startX = floor(lowerBx / i);
+						startX *= i;
+						for (double b = startY; b <= highBy; b += i)
+						{
+							for (double bb = startX; bb <= highBx; bb += i)
+							{
+								p->drawLine(FPoint(bb, b), FPoint(bb, b));
+							}
+						}
+						i = m_doc->guidesPrefs().majorGridSpacing;
+						p->setPen(m_doc->guidesPrefs().minorGridColor, lineWidth * 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+						startY = floor(lowerBy / i);
+						startY *= i;
+						startX = floor(lowerBx / i);
+						startX *= i;
+						for (double b = startY; b <= highBy; b += i)
+						{
+							for (double bb = startX; bb <= highBx; bb += i)
+							{
+								p->drawLine(FPoint(bb - 4, b), FPoint(bb + 4, b));
+								p->drawLine(FPoint(bb, b - 4), FPoint(bb, b + 4));
+							}
+						} */
+						double i,start;
+						i = m_doc->guidesPrefs().majorGridSpacing;
+						p->setPen(m_doc->guidesPrefs().majorGridColor, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+						start = floor(lowerBy / i);
+						start *= i;
+						for (double b = start; b <= highBy; b+=i)
+						{
+							p->drawLine(FPoint(qMax(lowerBx, 0.0), b), FPoint(qMin(pageWidth, highBx), b));
+						}
+						start=floor(lowerBx/i);
+						start*=i;
+						for (double b = start; b <= highBx; b+=i)
+						{
+							p->drawLine(FPoint(b, qMax(lowerBy, 0.0)), FPoint(b, qMin(pageHeight, highBy)));
+						}
+						i = m_doc->guidesPrefs().minorGridSpacing;
+						p->setPen(m_doc->guidesPrefs().minorGridColor, lineWidth, Qt::DotLine, Qt::FlatCap, Qt::MiterJoin);
+						start = floor(lowerBy / i);
+						start *= i;
+						for (double b = start; b <= highBy; b+=i)
+						{
+							p->drawLine(FPoint(qMax(lowerBx, 0.0), b), FPoint(qMin(pageWidth, highBx), b));
+						}
+						start=floor(lowerBx/i);
+						start*=i;
+						for (double b = start; b <= highBx; b+=i)
+						{
+							p->drawLine(FPoint(b, qMax(lowerBy, 0.0)), FPoint(b, qMin(pageHeight, highBy)));
+						}
+					}
+				}
+				p->setAntialiasing(true);
+				p->restore();
+			}
+		}
+	}
+}
+
+/**
+  draws guides
+ */
+void Canvas::DrawPageGuides(ScPainter *p, QRectF clip, bool master)
+{
+	if (master)
+	{
+		ScPage *page = m_doc->currentPage();
+		double x = m_doc->scratch()->Left * m_viewMode.scale;
+		double y = m_doc->scratch()->Top * m_viewMode.scale;
+		double w = page->width() * m_viewMode.scale;
+		double h = page->height() * m_viewMode.scale;
+		QRectF drawRect = QRectF(x, y, w+5, h+5);
+		drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+		if (drawRect.intersects(clip))
+		{
+			p->save();
+			p->setAntialiasing(false);
+			p->translate(page->xOffset(), page->yOffset());
+			double lineWidth = 1.0 / m_viewMode.scale;
+			p->setFillMode(ScPainter::None);
+			p->setStrokeMode(ScPainter::Solid);
+			p->setPen(Qt::black, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+			if (m_doc->guidesPrefs().guidesShown)
+				page->guides.drawPage(p, m_doc, lineWidth);
+			p->setAntialiasing(true);
+			p->restore();
+		}
+	}
+	else
+	{
+		uint docPagesCount = m_doc->Pages->count();
+		for (uint a = 0; a < docPagesCount; ++a)
+		{
+			ScPage *page = m_doc->Pages->at(a);
+			QRectF drawRect = QRectF(page->xOffset() * m_viewMode.scale, page->yOffset() * m_viewMode.scale, page->width() * m_viewMode.scale + 5, page->height() * m_viewMode.scale + 5);
+			drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+			if (drawRect.intersects(clip))
+			{
+				p->save();
+				p->setAntialiasing(false);
+				p->translate(page->xOffset(), page->yOffset());
+				double lineWidth = 1.0 / m_viewMode.scale;
+				p->setFillMode(ScPainter::None);
+				p->setStrokeMode(ScPainter::Solid);
+				p->setPen(Qt::black, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+				if (m_doc->guidesPrefs().guidesShown)
+					page->guides.drawPage(p, m_doc, lineWidth);
+				p->setAntialiasing(true);
+				p->restore();
+			}
+		}
+	}
+}
+
+/**
+  draws actual page indicator frame
+ */
+void Canvas::DrawPageIndicator(ScPainter *p, QRectF clip, bool master)
+{
+	if (master)
+	{
+		ScPage *page = m_doc->currentPage();
+		double x = m_doc->scratch()->Left * m_viewMode.scale;
+		double y = m_doc->scratch()->Top * m_viewMode.scale;
+		double w = page->width() * m_viewMode.scale;
+		double h = page->height() * m_viewMode.scale;
+		QRectF drawRect = QRectF(x, y, w+5, h+5);
+		drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+		if (drawRect.intersects(clip))
+		{
+			p->save();
+			p->setAntialiasing(false);
+			p->translate(page->xOffset(), page->yOffset());
+			double lineWidth = 1.0 / m_viewMode.scale;
+			double pageHeight = page->height();
+			double pageWidth = page->width();
+			p->setFillMode(ScPainter::None);
+			p->setStrokeMode(ScPainter::Solid);
+			p->setPen(Qt::black, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+			p->setPen(PrefsManager::instance()->appPrefs.displayPrefs.pageBorderColor, 1 / m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+			p->drawRect(0, 0, pageWidth, pageHeight);
+			p->setAntialiasing(true);
+			p->restore();
+		}
+	}
+	else
+	{
+		uint docPagesCount = m_doc->Pages->count();
+		for (uint a = 0; a < docPagesCount; ++a)
+		{
+			ScPage *page = m_doc->Pages->at(a);
+			QRectF drawRect = QRectF(page->xOffset() * m_viewMode.scale, page->yOffset() * m_viewMode.scale, page->width() * m_viewMode.scale + 5, page->height() * m_viewMode.scale + 5);
+			drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+			if (drawRect.intersects(clip))
+			{
+				p->save();
+				p->setAntialiasing(false);
+				p->translate(page->xOffset(), page->yOffset());
+				double lineWidth = 1.0 / m_viewMode.scale;
+				double pageHeight = page->height();
+				double pageWidth = page->width();
+				p->setFillMode(ScPainter::None);
+				p->setStrokeMode(ScPainter::Solid);
+				p->setPen(Qt::black, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+				if (m_doc->currentPage() == page)
+				{
+					p->setPen(PrefsManager::instance()->appPrefs.displayPrefs.pageBorderColor, 1 / m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+					p->drawRect(0, 0, pageWidth, pageHeight);
+				}
+				p->setAntialiasing(true);
+				p->restore();
+			}
+		}
+	}
+}
 
 /**
   draws the links between textframe chains.

Modified: trunk/Scribus/scribus/canvas.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16990&path=/trunk/Scribus/scribus/canvas.h
==============================================================================
--- trunk/Scribus/scribus/canvas.h (original)
+++ trunk/Scribus/scribus/canvas.h Sat Nov 19 22:43:33 2011
@@ -28,6 +28,7 @@
 //#include <QDebug>
 #include <QPolygon>
 #include <QRect>
+#include <QRectF>
 #include <QWidget>
 
 #include "scribusapi.h"
@@ -212,7 +213,12 @@
 	void setupEditHRuler(PageItem * item, bool forceAndReset = false);
 	
 private:
-	void DrawPageMarks(ScPainter *p, ScPage* page, QRect clip);
+	void DrawPageBorder(ScPainter *p, QRectF clip, bool master = false);
+	void DrawPageMargins(ScPainter *p, QRectF clip, bool master = false);
+	void DrawPageBaselineGrid(ScPainter *p, QRectF clip, bool master = false);
+	void DrawPageGrid(ScPainter *p, QRectF clip, bool master = false);
+	void DrawPageGuides(ScPainter *p, QRectF clip, bool master = false);
+	void DrawPageIndicator(ScPainter *p, QRectF clip, bool master = false);
 	void drawLinkFrameLine(ScPainter* painter, FPoint &start, FPoint &end);
 	void PaintSizeRect(QRect neu);
 	void PaintSizeRect(QPolygon neu);
@@ -233,7 +239,6 @@
 	void drawContents(QPainter *p, int clipx, int clipy, int clipw, int cliph);
 	void drawBackgroundMasterpage(ScPainter* painter, int clipx, int clipy, int clipw, int cliph);
 	void drawBackgroundPageOutlines(ScPainter* painter, int clipx, int clipy, int clipw, int cliph);
-	void drawGuides(ScPainter* painter, int clipx, int clipy, int clipw, int cliph);
 	void drawFrameLinks(ScPainter* painter);
 	void drawControls(QPainter* p);
 	void drawControlsMovingItemsRect(QPainter* pp);

Modified: trunk/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16990&path=/trunk/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_normal.cpp Sat Nov 19 22:43:33 2011
@@ -307,7 +307,7 @@
 			frameResizeHandle = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), QRectF(gx, gy, gw, gh));
 		}
 		enableGuideGesture |= (frameResizeHandle == Canvas::OUTSIDE);
-		enableGuideGesture |= ((!m_doc->guidesPrefs().guidePlacement) && (frameResizeHandle == Canvas::INSIDE));
+		enableGuideGesture |= ((m_doc->guidesPrefs().renderStackOrder.indexOf(3) > m_doc->guidesPrefs().renderStackOrder.indexOf(4)) && (frameResizeHandle == Canvas::INSIDE));
 		if (enableGuideGesture)
 		{
 			if (!guideMoveGesture)
@@ -1134,7 +1134,7 @@
 	QRectF mpo(m_mouseCurrentPoint.x()-grabRadius, m_mouseCurrentPoint.y()-grabRadius, grabRadius*2, grabRadius*2);
 	m_doc->nodeEdit.deselect();
 
-	if(!m_doc->guidesPrefs().guidePlacement) // guides are on foreground and want to be processed first
+	if (m_doc->guidesPrefs().renderStackOrder.indexOf(3) > m_doc->guidesPrefs().renderStackOrder.indexOf(4)) // guides are on foreground and want to be processed first
 	{
 		if ((m_doc->guidesPrefs().guidesShown) && (m_doc->OnPage(MxpS, MypS) != -1))
 		{

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16990&path=/trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp Sat Nov 19 22:43:33 2011
@@ -801,6 +801,8 @@
 		m_Doc->guidesPrefs().linkShown = prefsManager->appPrefs.guidesPrefs.linkShown;
 		m_Doc->guidesPrefs().showPic = true;
 		m_Doc->guidesPrefs().showControls = false;
+		m_Doc->guidesPrefs().renderStackOrder.clear();
+		m_Doc->guidesPrefs().renderStackOrder << 0 << 1 << 2 << 3 << 4;
 // 		DoFonts.clear();
 		m_Doc->itemToolPrefs().textSize=qRound(ScCLocale::toDoubleC(dc.attribute("DSIZE")) * 10);
 		Defont=dc.attribute("DFONT");

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16990&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp Sat Nov 19 22:43:33 2011
@@ -947,7 +947,11 @@
 		doc->guidesPrefs().guideColor = QColor(attrs.valueAsString("GuideC"));
 	if (attrs.hasAttribute("BaseC"))
 		doc->guidesPrefs().baselineGridColor  = QColor(attrs.valueAsString("BaseC"));
-	doc->guidesPrefs().guidePlacement   = attrs.valueAsBool("BACKG", true);
+	doc->guidesPrefs().renderStackOrder.clear();
+	if (attrs.valueAsBool("BACKG", true))
+		doc->guidesPrefs().renderStackOrder << 0 << 1 << 2 << 3 << 4;
+	else
+		doc->guidesPrefs().renderStackOrder << 4 << 0 << 1 << 2 << 3;
 	doc->guidesPrefs().guideRad = attrs.valueAsDouble("GuideRad", 10.0);
 	doc->guidesPrefs().grabRadius  = attrs.valueAsInt("GRAB", 4);
 }

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16990&path=/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp Sat Nov 19 22:43:33 2011
@@ -424,7 +424,11 @@
 		if (dc.hasAttribute("BaseC"))
 			m_Doc->guidesPrefs().baselineGridColor = QColor(dc.attribute("BaseC"));
 		m_Doc->setMarginColored(static_cast<bool>(dc.attribute("RANDF", "0").toInt()));
-		m_Doc->guidesPrefs().guidePlacement = static_cast<bool>(dc.attribute("BACKG", "1").toInt());
+		m_Doc->guidesPrefs().renderStackOrder.clear();
+		if (static_cast<bool>(dc.attribute("BACKG", "1").toInt()))
+			m_Doc->guidesPrefs().renderStackOrder << 0 << 1 << 2 << 3 << 4;
+		else
+			m_Doc->guidesPrefs().renderStackOrder << 4 << 0 << 1 << 2 << 3;
 		m_Doc->guidesPrefs().guideRad = ScCLocale::toDoubleC(dc.attribute("GuideRad"), 10.0);
 		m_Doc->guidesPrefs().grabRadius  = dc.attribute("GRAB", "4").toInt();
 		if (dc.hasAttribute("currentProfile"))

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16990&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Sat Nov 19 22:43:33 2011
@@ -1969,7 +1969,26 @@
 		doc->guidesPrefs().guideColor = QColor(attrs.valueAsString("GuideC"));
 	if (attrs.hasAttribute("BaseC"))
 		doc->guidesPrefs().baselineGridColor  = QColor(attrs.valueAsString("BaseC"));
-	doc->guidesPrefs().guidePlacement   = attrs.valueAsBool("BACKG", true);
+	if (attrs.hasAttribute("BACKG"))
+	{
+		doc->guidesPrefs().renderStackOrder.clear();
+		if (attrs.valueAsBool("BACKG", true))
+			doc->guidesPrefs().renderStackOrder << 0 << 1 << 2 << 3 << 4;
+		else
+			doc->guidesPrefs().renderStackOrder << 4 << 0 << 1 << 2 << 3;
+	}
+	if (attrs.hasAttribute("renderStack"))
+	{
+		doc->guidesPrefs().renderStackOrder.clear();
+		QString renderStack = attrs.valueAsString("renderStack", "0 1 2 3 4");
+		ScTextStream fp(&renderStack, QIODevice::ReadOnly);
+		QString val;
+		while (!fp.atEnd())
+		{
+			fp >> val;
+			doc->guidesPrefs().renderStackOrder << val.toInt();
+		}
+	}
 	doc->guidesPrefs().guideRad = attrs.valueAsDouble("GuideRad", 10.0);
 	doc->guidesPrefs().grabRadius  = attrs.valueAsInt("GRAB", 4);
 }

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16990&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Sat Nov 19 22:43:33 2011
@@ -331,8 +331,13 @@
 	docu.writeAttribute("MAJORC",m_Doc->guidesPrefs().majorGridColor.name());
 	docu.writeAttribute("GuideC", m_Doc->guidesPrefs().guideColor.name());
 	docu.writeAttribute("BaseC", m_Doc->guidesPrefs().baselineGridColor.name());
-//	docu.writeAttribute("GuideZ", m_Doc->guidesPrefs().guideRad);
-	docu.writeAttribute("BACKG", static_cast<int>(m_Doc->guidesPrefs().guidePlacement));
+	QString renderStack = "";
+	int renderStackCount = m_Doc->guidesPrefs().renderStackOrder.count();
+	for (int r = 0; r < renderStackCount; r++)
+	{
+		renderStack += QString("%1 ").arg(m_Doc->guidesPrefs().renderStackOrder[r]);
+	}
+	docu.writeAttribute("renderStack", renderStack.trimmed());
 	docu.writeAttribute("PAGEC",m_Doc->paperColor().name());
 	docu.writeAttribute("MARGC",m_Doc->guidesPrefs().marginColor.name());
 	docu.writeAttribute("RANDF", static_cast<int>(m_Doc->marginColored()));

Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16990&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp (original)
+++ trunk/Scribus/scribus/prefsmanager.cpp Sat Nov 19 22:43:33 2011
@@ -50,6 +50,7 @@
 #include "scpaths.h"
 #include "scribuscore.h"
 #include "scribusstructs.h"
+#include "sctextstream.h"
 #include "ui/modetoolbar.h"
 #include "util_color.h"
 #include "util_file.h"
@@ -181,6 +182,7 @@
 	appPrefs.guidesPrefs.marginColor = QColor(Qt::blue);
 	appPrefs.guidesPrefs.guideColor = QColor(Qt::darkBlue);
 	appPrefs.guidesPrefs.baselineGridColor = QColor(Qt::lightGray);
+	appPrefs.guidesPrefs.renderStackOrder << 0 << 1 << 2 << 3 << 4;
 	appPrefs.typoPrefs.valueSuperScript = 33;
 	appPrefs.typoPrefs.scalingSuperScript = 66;
 	appPrefs.typoPrefs.valueSubScript = 33;
@@ -258,7 +260,6 @@
 	appPrefs.itemToolPrefs.imageFillColorShade = 100;
 	appPrefs.itemToolPrefs.imageScaleX = 1;
 	appPrefs.itemToolPrefs.imageScaleY = 1;
-	appPrefs.guidesPrefs.guidePlacement = true;
 	appPrefs.docSetupPrefs.docUnitIndex = 0;
 	appPrefs.itemToolPrefs.polyCorners = 4;
 	appPrefs.itemToolPrefs.polyFactor = 0.5;
@@ -1338,7 +1339,14 @@
 	deGuides.setAttribute("MarginColor",appPrefs.guidesPrefs.marginColor.name());
 	deGuides.setAttribute("BaselineGridColor", appPrefs.guidesPrefs.baselineGridColor.name());
 	deGuides.setAttribute("ObjectToGuideSnapRadius", ScCLocale::toQStringC(appPrefs.guidesPrefs.guideRad));
-	deGuides.setAttribute("GuidePlacement", static_cast<int>(appPrefs.guidesPrefs.guidePlacement));
+	QString renderStack = "";
+	int renderStackCount = appPrefs.guidesPrefs.renderStackOrder.count();
+	for (int r = 0; r < renderStackCount; r++)
+	{
+		renderStack += QString("%1 ").arg(appPrefs.guidesPrefs.renderStackOrder[r]);
+	}
+	renderStack = renderStack.trimmed();
+	deGuides.setAttribute("renderStack", renderStack);
 	deGuides.setAttribute("ShowGrid", static_cast<int>(appPrefs.guidesPrefs.gridShown));
 	deGuides.setAttribute("BaselineGridDistance", ScCLocale::toQStringC(appPrefs.guidesPrefs.valueBaselineGrid));
 	deGuides.setAttribute("BaselineGridOffset", ScCLocale::toQStringC(appPrefs.guidesPrefs.offsetBaselineGrid));
@@ -1969,7 +1977,26 @@
 			appPrefs.guidesPrefs.majorGridSpacing  = ScCLocale::toDoubleC(dc.attribute("MajorGridSpacing"), 100.0);
 			appPrefs.guidesPrefs.minorGridColor = QColor(dc.attribute("MinorGridColor"));
 			appPrefs.guidesPrefs.majorGridColor = QColor(dc.attribute("MajorGridColor"));
-			appPrefs.guidesPrefs.guidePlacement = static_cast<bool>(dc.attribute("GuidePlacement", "1").toInt());
+			if (dc.hasAttribute("GuidePlacement"))
+			{
+				appPrefs.guidesPrefs.renderStackOrder.clear();
+				if (static_cast<bool>(dc.attribute("GuidePlacement", "1").toInt()))
+					appPrefs.guidesPrefs.renderStackOrder << 0 << 1 << 2 << 3 << 4;
+				else
+					appPrefs.guidesPrefs.renderStackOrder << 4 << 0 << 1 << 2 << 3;
+			}
+			if (dc.hasAttribute("renderStack"))
+			{
+				appPrefs.guidesPrefs.renderStackOrder.clear();
+				QString renderStack = dc.attribute("renderStack", "0 1 2 3 4");
+				ScTextStream fp(&renderStack, QIODevice::ReadOnly);
+				QString val;
+				while (!fp.atEnd())
+				{
+					fp >> val;
+					appPrefs.guidesPrefs.renderStackOrder << val.toInt();
+				}
+			}
 			appPrefs.guidesPrefs.gridShown = static_cast<bool>(dc.attribute("ShowGrid", "0").toInt());
 			if (dc.hasAttribute("GuideC"))
 				appPrefs.guidesPrefs.guideColor = QColor(dc.attribute("GuideC"));

Modified: trunk/Scribus/scribus/prefsstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16990&path=/trunk/Scribus/scribus/prefsstructs.h
==============================================================================
--- trunk/Scribus/scribus/prefsstructs.h (original)
+++ trunk/Scribus/scribus/prefsstructs.h Sat Nov 19 22:43:33 2011
@@ -134,7 +134,12 @@
 //Guides
 struct GuidesPrefs
 {
-	bool guidePlacement; //! Placement of guides, in front or behind
+	QList<int> renderStackOrder;
+	// render stack id 0 = PageMargins
+	// render stack id 1 = BaselineGrid
+	// render stack id 2 = Grid
+	// render stack id 3 = Guides
+	// render stack id 4 = Items
 
 	int grabRadius;
 	double guideRad;

Modified: trunk/Scribus/scribus/ui/prefs_guides.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16990&path=/trunk/Scribus/scribus/ui/prefs_guides.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_guides.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_guides.cpp Sat Nov 19 22:43:33 2011
@@ -11,18 +11,26 @@
 #include "scribusdoc.h"
 #include "scrspinbox.h"
 #include "units.h"
+#include "util_icon.h"
 
 Prefs_Guides::Prefs_Guides(QWidget* parent, ScribusDoc* doc)
 	: Prefs_Pane(parent)
 {
 	setupUi(this);
 	languageChange();
+	buttonUp->setIcon(loadIcon("16/go-up.png"));
+	buttonUp->setEnabled(false);
+	buttonDown->setIcon(loadIcon("16/go-down.png"));
+	buttonDown->setEnabled(false);
 
 	connect(guideColorPushButton, SIGNAL(clicked()), this, SLOT(changeGuideColor()));
 	connect(marginColorPushButton, SIGNAL(clicked()), this, SLOT(changeMarginColor()));
 	connect(majorGridColorPushButton, SIGNAL(clicked()), this, SLOT(changeMajorColor()));
 	connect(minorGridColorPushButton, SIGNAL(clicked()), this, SLOT(changeMinorColor()));
 	connect(baselineGridColorPushButton, SIGNAL(clicked()), this, SLOT(changeBaselineColor()));
+	connect(buttonUp, SIGNAL(clicked()), this, SLOT(moveUp()));
+	connect(buttonDown, SIGNAL(clicked()), this, SLOT(moveDown()));
+	connect(guidePlacementListBox, SIGNAL(itemPressed(QListWidgetItem*)), this, SLOT(select(QListWidgetItem*)));
 }
 
 Prefs_Guides::~Prefs_Guides()
@@ -31,13 +39,26 @@
 
 void Prefs_Guides::languageChange()
 {
-	int i=guidePlacementComboBox->currentIndex();
-	guidePlacementComboBox->clear();
-	guidePlacementComboBox->addItem( tr ("In the Background") );
-	guidePlacementComboBox->addItem( tr ("In the Foreground") );
-	guidePlacementComboBox->setCurrentIndex(i<0?0:i);
-
-	guidePlacementComboBox->setToolTip( tr( "Place guides in front of or behind objects on the page" ) );
+	guidePlacementListBox->clear();
+	int renderStackCount = renderStackOrder.count();
+	for (int r = renderStackCount - 1; r > -1; r--)
+	{
+		QListWidgetItem *item;
+		int it = renderStackOrder[r];
+		if (it == 4)
+			item = new QListWidgetItem( tr("Content Objects"), guidePlacementListBox);
+		else if (it == 3)
+			item = new QListWidgetItem( tr("Guides"), guidePlacementListBox);
+		else if (it == 2)
+			item = new QListWidgetItem( tr("Grid"), guidePlacementListBox);
+		else if (it == 1)
+			item = new QListWidgetItem( tr("Baseline Grid"), guidePlacementListBox);
+		else if (it == 0)
+			item = new QListWidgetItem( tr("Margins"), guidePlacementListBox);
+		item->setData(Qt::UserRole, it);
+		item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
+	}
+	guidePlacementListBox->setToolTip( tr( "Place guides in front of or behind objects on the page" ) );
 	minorGridSpacingSpinBox->setToolTip( tr( "Distance between the minor grid lines" ) );
 	majorGridSpacingSpinBox->setToolTip( tr( "Distance between the major grid lines" ) );
 	guideSnapDistanceSpinBox->setToolTip(  "<qt>" + tr( "Distance within which an object will snap to your placed guides. After setting this you will need to restart Scribus to set this setting." ) + "</qt>");
@@ -72,7 +93,26 @@
 	int docUnitIndex = prefsData->docSetupPrefs.docUnitIndex;
 	unitChange(docUnitIndex);
 	double unitRatio = unitGetRatioFromIndex(docUnitIndex);
-	guidePlacementComboBox->setCurrentIndex(prefsData->guidesPrefs.guidePlacement ?0:1);
+	renderStackOrder = prefsData->guidesPrefs.renderStackOrder;
+	guidePlacementListBox->clear();
+	int renderStackCount = renderStackOrder.count();
+	for (int r = renderStackCount - 1; r > -1; r--)
+	{
+		QListWidgetItem *item;
+		int it = renderStackOrder[r];
+		if (it == 4)
+			item = new QListWidgetItem( tr("Content Objects"), guidePlacementListBox);
+		else if (it == 3)
+			item = new QListWidgetItem( tr("Guides"), guidePlacementListBox);
+		else if (it == 2)
+			item = new QListWidgetItem( tr("Grid"), guidePlacementListBox);
+		else if (it == 1)
+			item = new QListWidgetItem( tr("BaselineGrid"), guidePlacementListBox);
+		else if (it == 0)
+			item = new QListWidgetItem( tr("Margins"), guidePlacementListBox);
+		item->setData(Qt::UserRole, it);
+		item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
+	}
 	guideSnapDistanceSpinBox->setValue(prefsData->guidesPrefs.guideRad);
 	guideGrabRadiusSpinBox->setValue(prefsData->guidesPrefs.grabRadius);
 	visibilityGuidesCheckBox->setChecked(prefsData->guidesPrefs.guidesShown);
@@ -115,7 +155,7 @@
 
 void Prefs_Guides::saveGuiToPrefs(struct ApplicationPrefs *prefsData) const
 {
-	prefsData->guidesPrefs.guidePlacement=(guidePlacementComboBox->currentIndex()==0);
+	prefsData->guidesPrefs.renderStackOrder = renderStackOrder;
 	prefsData->guidesPrefs.guideRad=guideSnapDistanceSpinBox->value();
 	prefsData->guidesPrefs.grabRadius=guideGrabRadiusSpinBox->value();
 	prefsData->guidesPrefs.guidesShown=visibilityGuidesCheckBox->isChecked();
@@ -194,3 +234,70 @@
 	}
 }
 
+void Prefs_Guides::changeRenderStack()
+{
+	renderStackOrder.clear();
+	for (int a = 0; a < guidePlacementListBox->count(); a++)
+	{
+		renderStackOrder.prepend(guidePlacementListBox->item(a)->data(Qt::UserRole).toInt());
+	}
+	int curr = guidePlacementListBox->currentRow();
+	if (curr == 0)
+	{
+		buttonUp->setEnabled(false);
+		buttonDown->setEnabled(true);
+	}
+	else if (curr == guidePlacementListBox->count() - 1)
+	{
+		buttonUp->setEnabled(true);
+		buttonDown->setEnabled(false);
+	}
+	else
+	{
+		buttonUp->setEnabled(true);
+		buttonDown->setEnabled(true);
+	}
+}
+
+void Prefs_Guides::moveUp()
+{
+	int curr = guidePlacementListBox->currentRow();
+	if (curr == 0)
+		return;
+	QListWidgetItem *it = guidePlacementListBox->takeItem(curr);
+	guidePlacementListBox->insertItem(curr-1, it);
+	guidePlacementListBox->setCurrentItem(it);
+	changeRenderStack();
+}
+
+void Prefs_Guides::moveDown()
+{
+	int curr = guidePlacementListBox->currentRow();
+	if (curr == static_cast<int>(guidePlacementListBox->count())-1)
+		return;
+	QListWidgetItem *it = guidePlacementListBox->takeItem(curr);
+	guidePlacementListBox->insertItem(curr+1, it);
+	guidePlacementListBox->setCurrentItem(it);
+	changeRenderStack();
+}
+
+void Prefs_Guides::select(QListWidgetItem* item)
+{
+	guidePlacementListBox->setCurrentItem(item);
+	int curr = guidePlacementListBox->currentRow();
+	if (curr == 0)
+	{
+		buttonUp->setEnabled(false);
+		buttonDown->setEnabled(true);
+	}
+	else if (curr == guidePlacementListBox->count() - 1)
+	{
+		buttonUp->setEnabled(true);
+		buttonDown->setEnabled(false);
+	}
+	else
+	{
+		buttonUp->setEnabled(true);
+		buttonDown->setEnabled(true);
+	}
+}

Modified: trunk/Scribus/scribus/ui/prefs_guides.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16990&path=/trunk/Scribus/scribus/ui/prefs_guides.h
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_guides.h (original)
+++ trunk/Scribus/scribus/ui/prefs_guides.h Sat Nov 19 22:43:33 2011
@@ -34,6 +34,10 @@
 		virtual void changeBaselineColor();
 		virtual void changeGuideColor();
 		virtual void changeMarginColor();
+		virtual void changeRenderStack();
+		virtual void moveUp();
+		virtual void moveDown();
+		virtual void select(QListWidgetItem* item);
 
 	protected:
 		QColor colorGuides;
@@ -41,6 +45,7 @@
 		QColor colorMajorGrid;
 		QColor colorMinorGrid;
 		QColor colorBaselineGrid;
+		QList<int> renderStackOrder;
 };
 
 #endif // PREFS_GUIDES_H

Modified: trunk/Scribus/scribus/ui/prefs_guidesbase.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16990&path=/trunk/Scribus/scribus/ui/prefs_guidesbase.ui
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_guidesbase.ui (original)
+++ trunk/Scribus/scribus/ui/prefs_guidesbase.ui Sat Nov 19 22:43:33 2011
@@ -37,86 +37,206 @@
       <attribute name="title">
        <string>Placement</string>
       </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout">
-       <item>
-        <layout class="QFormLayout" name="formLayout">
-         <property name="formAlignment">
-          <set>Qt::AlignHCenter|Qt::AlignTop</set>
-         </property>
-         <item row="0" column="0">
-          <widget class="QLabel" name="label_2">
-           <property name="text">
-            <string>Placement:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="0" column="1">
-          <widget class="QComboBox" name="guidePlacementComboBox">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="0">
-          <widget class="QLabel" name="label_4">
-           <property name="text">
-            <string>Snap Distance:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="1">
-          <widget class="ScrSpinBox" name="guideSnapDistanceSpinBox">
-           <property name="suffix">
-            <string> px</string>
-           </property>
-           <property name="minimum">
-            <number>1</number>
-           </property>
-           <property name="maximum">
-            <number>1000</number>
-           </property>
-          </widget>
-         </item>
-         <item row="2" column="0">
-          <widget class="QLabel" name="label_3">
-           <property name="text">
-            <string>Grab Radius:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="2" column="1">
-          <widget class="ScrSpinBox" name="guideGrabRadiusSpinBox">
-           <property name="suffix">
-            <string> px</string>
-           </property>
-           <property name="minimum">
-            <number>1</number>
-           </property>
-           <property name="maximum">
-            <number>1000</number>
-           </property>
-          </widget>
+      <layout class="QVBoxLayout" name="verticalLayout_7">
+       <item>
+        <widget class="QLabel" name="label_2">
+         <property name="font">
+          <font>
+           <weight>75</weight>
+           <bold>true</bold>
+          </font>
+         </property>
+         <property name="text">
+          <string>Placement:</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="Line" name="line_3">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout">
+         <item>
+          <widget class="QListWidget" name="guidePlacementListBox">
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>200</height>
+            </size>
+           </property>
+           <property name="dragDropMode">
+            <enum>QAbstractItemView::NoDragDrop</enum>
+           </property>
+           <property name="layoutMode">
+            <enum>QListView::SinglePass</enum>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_6">
+           <item>
+            <widget class="QLabel" name="label_5">
+             <property name="text">
+              <string>Foreground</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="verticalSpacer_5">
+             <property name="orientation">
+              <enum>Qt::Vertical</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>20</width>
+               <height>18</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <layout class="QVBoxLayout" name="verticalLayout">
+             <property name="sizeConstraint">
+              <enum>QLayout::SetMinimumSize</enum>
+             </property>
+             <item>
+              <widget class="QPushButton" name="buttonUp">
+               <property name="enabled">
+                <bool>false</bool>
+               </property>
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+               <property name="text">
+                <string/>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QPushButton" name="buttonDown">
+               <property name="enabled">
+                <bool>false</bool>
+               </property>
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+               <property name="text">
+                <string/>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+           <item>
+            <spacer name="verticalSpacer_6">
+             <property name="orientation">
+              <enum>Qt::Vertical</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>20</width>
+               <height>40</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="QLabel" name="label_6">
+             <property name="text">
+              <string>Background</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_5">
+           <item>
+            <layout class="QGridLayout" name="gridLayout">
+             <item row="0" column="0">
+              <widget class="QLabel" name="label_4">
+               <property name="text">
+                <string>Snap Distance:</string>
+               </property>
+              </widget>
+             </item>
+             <item row="0" column="1">
+              <widget class="ScrSpinBox" name="guideSnapDistanceSpinBox">
+               <property name="suffix">
+                <string> px</string>
+               </property>
+               <property name="minimum">
+                <number>1</number>
+               </property>
+               <property name="maximum">
+                <number>1000</number>
+               </property>
+              </widget>
+             </item>
+             <item row="1" column="0">
+              <widget class="QLabel" name="label_3">
+               <property name="text">
+                <string>Grab Radius:</string>
+               </property>
+              </widget>
+             </item>
+             <item row="1" column="1">
+              <widget class="ScrSpinBox" name="guideGrabRadiusSpinBox">
+               <property name="suffix">
+                <string> px</string>
+               </property>
+               <property name="minimum">
+                <number>1</number>
+               </property>
+               <property name="maximum">
+                <number>1000</number>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+           <item>
+            <spacer name="verticalSpacer_3">
+             <property name="orientation">
+              <enum>Qt::Vertical</enum>
+             </property>
+             <property name="sizeType">
+              <enum>QSizePolicy::Expanding</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>20</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
          </item>
         </layout>
-       </item>
-       <item>
-        <spacer name="verticalSpacer_3">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeType">
-          <enum>QSizePolicy::Fixed</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
        </item>
        <item>
         <widget class="QLabel" name="label_7">
@@ -139,49 +259,63 @@
         </widget>
        </item>
        <item>
-        <layout class="QFormLayout" name="formLayout_3">
-         <property name="fieldGrowthPolicy">
-          <enum>QFormLayout::FieldsStayAtSizeHint</enum>
-         </property>
-         <item row="0" column="1">
-          <widget class="ScrSpinBox" name="majorGridSpacingSpinBox"/>
-         </item>
-         <item row="1" column="0">
-          <widget class="QLabel" name="minorGridSpacingLabel">
-           <property name="text">
-            <string>Minor Grid Spacing:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="1">
-          <widget class="ScrSpinBox" name="minorGridSpacingSpinBox"/>
-         </item>
-         <item row="2" column="0">
-          <widget class="QLabel" name="baselineGridSpacingLabel">
-           <property name="text">
-            <string>Baseline Grid Spacing:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="2" column="1">
-          <widget class="ScrSpinBox" name="baselineGridSpacingSpinBox"/>
-         </item>
-         <item row="0" column="0">
-          <widget class="QLabel" name="majorGridSpacingLabel">
-           <property name="text">
-            <string>Major Grid Spacing:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="3" column="0">
-          <widget class="QLabel" name="baselineGridOffsetLabel">
-           <property name="text">
-            <string>Baseline Grid Offset:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="3" column="1">
-          <widget class="ScrSpinBox" name="baselineGridOffsetSpinBox"/>
+        <layout class="QHBoxLayout" name="horizontalLayout_2">
+         <item>
+          <layout class="QGridLayout" name="gridLayout_2">
+           <item row="0" column="0">
+            <widget class="QLabel" name="majorGridSpacingLabel">
+             <property name="text">
+              <string>Major Grid Spacing:</string>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="1">
+            <widget class="ScrSpinBox" name="majorGridSpacingSpinBox"/>
+           </item>
+           <item row="1" column="0">
+            <widget class="QLabel" name="minorGridSpacingLabel">
+             <property name="text">
+              <string>Minor Grid Spacing:</string>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="1">
+            <widget class="ScrSpinBox" name="minorGridSpacingSpinBox"/>
+           </item>
+           <item row="2" column="0">
+            <widget class="QLabel" name="baselineGridSpacingLabel">
+             <property name="text">
+              <string>Baseline Grid Spacing:</string>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="1">
+            <widget class="ScrSpinBox" name="baselineGridSpacingSpinBox"/>
+           </item>
+           <item row="3" column="0">
+            <widget class="QLabel" name="baselineGridOffsetLabel">
+             <property name="text">
+              <string>Baseline Grid Offset:</string>
+             </property>
+            </widget>
+           </item>
+           <item row="3" column="1">
+            <widget class="ScrSpinBox" name="baselineGridOffsetSpinBox"/>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_2">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
          </item>
         </layout>
        </item>




More information about the scribus-commit mailing list