r16890 by jghali - #10288: resizing a frame with keyboard is not blocked when resizing is off

scribus-commit scribus-commit at lists.scribus.net
Fri Oct 7 23:56:54 UTC 2011


Author: jghali
Date: Fri Oct  7 23:56:54 2011
New Revision: 16890

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16890
Log:
#10288: resizing a frame with keyboard is not blocked when resizing is off

Modified:
    trunk/Scribus/scribus/canvasmode.cpp
    trunk/Scribus/scribus/ui/propertiespalette_shape.cpp
    trunk/Scribus/scribus/ui/propertiespalette_shape.h

Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16890&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Fri Oct  7 23:56:54 2011
@@ -1198,20 +1198,15 @@
 						//CB If in EditContour mode, allow contour line to be scaled with arrow keys too
 						if(m_doc->nodeEdit.isContourLine)
 							m_view->TransformPoly(10, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
-						else
-						{
-							if (resizingsmaller)
-							{
-								currItem->Sizing = false;
-								m_doc->SizeItem(currItem->width()+resizeBy, currItem->height(), currItem->ItemNr);
-							}
-							else
+						else if (!currItem->sizeLocked())
+						{
+							if (!resizingsmaller)
 							{
 								m_doc->MoveItem(-resizeBy, 0, currItem, false);
-								currItem->moveImageXYOffsetBy(resizeBy/currItem->imageXScale(), 0);
-								currItem->Sizing = false;
-								m_doc->SizeItem(currItem->width()+resizeBy, currItem->height(), currItem->ItemNr);
+								currItem->moveImageXYOffsetBy(resizeBy / currItem->imageXScale(), 0);
 							}
+							currItem->Sizing = false;
+							m_doc->SizeItem(currItem->width()+resizeBy, currItem->height(), currItem->ItemNr);
 						}
 					}
 					currItem->update();
@@ -1265,20 +1260,15 @@
 						//CB If in EditContour mode, allow contour line to be scaled with arrow keys too
 						if(m_doc->nodeEdit.isContourLine)
 							m_view->TransformPoly(11, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
-						else
+						else if (!currItem->sizeLocked())
 						{
 							if (resizingsmaller)
 							{
 								m_doc->MoveItem(-resizeBy, 0, currItem, false);
-								currItem->moveImageXYOffsetBy(resizeBy/currItem->imageXScale(), 0);
-								currItem->Sizing = false;
-								m_doc->SizeItem(currItem->width()+resizeBy, currItem->height(), currItem->ItemNr);
+								currItem->moveImageXYOffsetBy(resizeBy / currItem->imageXScale(), 0);
 							}
-							else
-							{
-								currItem->Sizing = false;
-								m_doc->SizeItem(currItem->width()+resizeBy, currItem->height(), currItem->ItemNr);
-							}
+							currItem->Sizing = false;
+							m_doc->SizeItem(currItem->width() + resizeBy, currItem->height(), currItem->ItemNr);
 						}
 					}
 					currItem->update();
@@ -1334,18 +1324,13 @@
 							m_view->TransformPoly(12, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
 						else
 						{
-							if (resizingsmaller)
-							{
-								currItem->Sizing = false;
-								m_doc->SizeItem(currItem->width(), currItem->height()+resizeBy, currItem->ItemNr);
-							}
-							else
+							if (!resizingsmaller)
 							{
 								m_doc->MoveItem(0, -resizeBy, currItem, false);
-								currItem->moveImageXYOffsetBy(0, resizeBy/currItem->imageYScale());
-								currItem->Sizing = false;
-								m_doc->SizeItem(currItem->width(), currItem->height()+resizeBy, currItem->ItemNr);
+								currItem->moveImageXYOffsetBy(0, resizeBy / currItem->imageYScale());
 							}
+							currItem->Sizing = false;
+							m_doc->SizeItem(currItem->width(), currItem->height() + resizeBy, currItem->ItemNr);
 						}
 					}
 					currItem->update();
@@ -1399,20 +1384,15 @@
 						//CB If in EditContour mode, allow contour line to be scaled with arrow keys too
 						if(m_doc->nodeEdit.isContourLine)
 							m_view->TransformPoly(13, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
-						else
+						else if (!currItem->sizeLocked())
 						{
 							if (resizingsmaller)
 							{
 								m_doc->MoveItem(0, -resizeBy, currItem, false);
-								currItem->moveImageXYOffsetBy(0, resizeBy/currItem->imageYScale());
-								currItem->Sizing = false;
-								m_doc->SizeItem(currItem->width(), currItem->height()+resizeBy, currItem->ItemNr);
+								currItem->moveImageXYOffsetBy(0, resizeBy / currItem->imageYScale());
 							}
-							else
-							{
-								currItem->Sizing = false;
-								m_doc->SizeItem(currItem->width(), currItem->height()+resizeBy, currItem->ItemNr);
-							}
+							currItem->Sizing = false;
+							m_doc->SizeItem(currItem->width(), currItem->height() + resizeBy, currItem->ItemNr);
 						}
 					}
 					currItem->update();

Modified: trunk/Scribus/scribus/ui/propertiespalette_shape.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16890&path=/trunk/Scribus/scribus/ui/propertiespalette_shape.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_shape.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_shape.cpp Fri Oct  7 23:56:54 2011
@@ -171,7 +171,11 @@
 	if (isLocked)
 		pal.setCurrentColorGroup(QPalette::Disabled);
 
-	editShape->setEnabled(!isLocked);
+	bool shapeEditLocked = isLocked;
+	if (m_haveItem)
+		shapeEditLocked |=  m_item->sizeLocked();
+	editShape->setEnabled(!shapeEditLocked);
+
 	if ((m_haveDoc) && (m_haveItem))
 	{
 		enableCustomShape();
@@ -180,6 +184,14 @@
 		else
 			roundRect->setEnabled(false);
 	}
+}
+
+void PropertiesPalette_Shape::setSizeLocked(bool isLocked)
+{
+	bool shapeEditLocked = isLocked;
+	if (m_haveItem)
+		shapeEditLocked |=  m_item->locked();
+	editShape->setEnabled(!shapeEditLocked);
 }
 
 void PropertiesPalette_Shape::setRoundRectEnabled(bool enabled)
@@ -221,7 +233,7 @@
 		m_haveItem = (itemType != -1);
 		if (itemType != -1)
 		{
-			editShape->setEnabled(!currItem->locked());
+			editShape->setEnabled(!currItem->locked() && !currItem->sizeLocked());
 			enableCustomShape();
 		}
 		else
@@ -354,6 +366,7 @@
 	}
 
 	setLocked(m_item->locked());
+	setSizeLocked(m_item->sizeLocked());
 	nonZero->setChecked(!m_item->fillRule);
 	evenOdd->setChecked(m_item->fillRule);
 

Modified: trunk/Scribus/scribus/ui/propertiespalette_shape.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16890&path=/trunk/Scribus/scribus/ui/propertiespalette_shape.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_shape.h (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_shape.h Fri Oct  7 23:56:54 2011
@@ -34,6 +34,7 @@
 
 	void setCustomShapeIcon(int submode);
 	void setLocked(bool isLocked);
+	void setSizeLocked(bool isLocked);
 	void setRoundRectEnabled(bool enabled);
 	void displayTextFlowMode(PageItem::TextFlowMode mode);
 




More information about the scribus-commit mailing list