r16296 by fschmid - Small fixes for the regular polygon and arc edit modes, leaving these modes is now possible with a double-click.

scribus-commit scribus-commit at lists.scribus.net
Sun Jan 23 11:43:32 CET 2011


Author: fschmid
Date: Sun Jan 23 10:43:31 2011
New Revision: 16296

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16296
Log:
Small fixes for the regular polygon and arc edit modes, leaving these modes is now possible with a double-click.

Modified:
    trunk/Scribus/scribus/canvasmode_editarc.cpp
    trunk/Scribus/scribus/canvasmode_editpolygon.cpp
    trunk/Scribus/scribus/ui/propertiespalette.cpp
    trunk/Scribus/scribus/ui/propertiespalette.h

Modified: trunk/Scribus/scribus/canvasmode_editarc.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16296&path=/trunk/Scribus/scribus/canvasmode_editarc.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editarc.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editarc.cpp Sun Jan 23 10:43:31 2011
@@ -186,6 +186,7 @@
 	connect(VectorDialog, SIGNAL(endEdit()), this, SLOT(endEditing()));
 	connect(VectorDialog, SIGNAL(paletteShown(bool)), this, SLOT(endEditing(bool)));
 	connect(m_doc, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
+	connect(m_ScMW->propertiesPalette, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
 }
 
 void CanvasMode_EditArc::updateFromItem()
@@ -263,6 +264,7 @@
 	m_view->redrawMarker->hide();
 	m_arcPoint = noPointDefined;
 	disconnect(m_doc, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
+	disconnect(m_ScMW->propertiesPalette, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
 }
 
 void CanvasMode_EditArc::mouseDoubleClickEvent(QMouseEvent *m)
@@ -270,37 +272,7 @@
 	m->accept();
 	m_canvas->m_viewMode.m_MouseButtonPressed = false;
 	m_canvas->resetRenderMode();
-	PageItem *currItem = 0;
-	if ((m_doc->m_Selection->isMultipleSelection()) || (m_doc->appMode != modeNormal))
-	{
-		if ((m_doc->m_Selection->isMultipleSelection()) && (m_doc->appMode == modeNormal))
-		{
-			if (GetItem(&currItem))
-			{
-				/* CB: old code, removing this as shift-alt select on an unselected table selects a cell now.
-				//#6789 is closed by sorting this.
-				if (currItem->isTableItem)
-				{
-					m_view->Deselect(false);
-					m_doc->m_Selection->addItem(currItem);
-					currItem->isSingleSel = true;
-					//CB FIXME dont call this if the added item is item 0
-					if (!m_doc->m_Selection->primarySelectionIs(currItem))
-						currItem->emitAllToGUI();
-					m_view->updateContents(currItem->getRedrawBounding(m_canvas->scale()));
-				}*/
-			}
-			return;
-		}
-		else
-		{
-			if (!(GetItem(&currItem) && (m_doc->appMode == modeEdit) && currItem->asTextFrame()))
-			{
-				mousePressEvent(m);
-				return;
-			}
-		}
-	}
+	m_view->requestMode(modeNormal);
 }
 
 

Modified: trunk/Scribus/scribus/canvasmode_editpolygon.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16296&path=/trunk/Scribus/scribus/canvasmode_editpolygon.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editpolygon.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editpolygon.cpp Sun Jan 23 10:43:31 2011
@@ -207,6 +207,8 @@
 	if (fromGesture)
 		m_view->update();
 	connect(m_doc, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
+	connect(m_ScMW->propertiesPalette, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
+	
 	connect(VectorDialog, SIGNAL(NewVectors(int, double, bool, double, double, double, double)), this, SLOT(applyValues(int, double, bool, double, double, double, double)));
 	connect(VectorDialog, SIGNAL(accepted()), this, SLOT(endEditing()));
 	connect(VectorDialog, SIGNAL(rejected()), this, SLOT(endEditing()));
@@ -219,6 +221,7 @@
 	m_view->redrawMarker->hide();
 	m_polygonPoint = noPointDefined;
 	disconnect(m_doc, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
+	disconnect(m_ScMW->propertiesPalette, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
 }
 
 void CanvasMode_EditPolygon::endEditing()
@@ -283,6 +286,7 @@
 	m->accept();
 	m_canvas->m_viewMode.m_MouseButtonPressed = false;
 	m_canvas->resetRenderMode();
+	m_view->requestMode(modeNormal);
 }
 
 void CanvasMode_EditPolygon::mouseMoveEvent(QMouseEvent *m)
@@ -313,7 +317,13 @@
 				polyFactor = factor;
 		}
 		if (m_polygonPoint == useControlOuter)
+		{
 			polyRotation = stLinA.angle() - 90;
+			if (polyRotation < -180)
+				polyRotation += 360;
+			if (polyRotation > 180)
+				polyRotation -= 360;
+		}
 		if (m_polygonPoint == useControlInnerCurve)
 		{
 			QPointF ePoint = itemMatrix.map(endPoint);

Modified: trunk/Scribus/scribus/ui/propertiespalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16296&path=/trunk/Scribus/scribus/ui/propertiespalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette.cpp Sun Jan 23 10:43:31 2011
@@ -3228,6 +3228,8 @@
 			CurItem->PoLine.translate(-tp2.x(), -tp2.y());
 			doc->AdjustItemSize(CurItem);
 		}
+		if (CurItem->isArc() || CurItem->isRegularPolygon())
+			emit updateEditItem();
 		CurItem->Sizing = oldS;
 	}
 	emit DocChanged();
@@ -3351,6 +3353,8 @@
 			CurItem->PoLine.translate(-tp2.x(), -tp2.y());
 			doc->AdjustItemSize(CurItem);
 		}
+		if (CurItem->isArc() || CurItem->isRegularPolygon())
+			emit updateEditItem();
 		emit DocChanged();
 		doc->regionsChanged()->update(QRect());
 	}

Modified: trunk/Scribus/scribus/ui/propertiespalette.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16296&path=/trunk/Scribus/scribus/ui/propertiespalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette.h (original)
+++ trunk/Scribus/scribus/ui/propertiespalette.h Sun Jan 23 10:43:31 2011
@@ -347,6 +347,7 @@
 	void ShapeEdit();
 	void NewFont(const QString&);
 	void UpdtGui(int);
+	void updateEditItem();
 
 protected:
 	ScribusMainWindow *m_ScMW;




More information about the scribus-commit mailing list