r16889 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:55:08 UTC 2011
Author: jghali
Date: Fri Oct 7 23:55:08 2011
New Revision: 16889
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16889
Log:
#10288: resizing a frame with keyboard is not blocked when resizing is off
Modified:
branches/Version135/Scribus/scribus/propertiespalette.cpp
branches/Version135/Scribus/scribus/scribus.cpp
Modified: branches/Version135/Scribus/scribus/propertiespalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16889&path=/branches/Version135/Scribus/scribus/propertiespalette.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/propertiespalette.cpp (original)
+++ branches/Version135/Scribus/scribus/propertiespalette.cpp Fri Oct 7 23:55:08 2011
@@ -2485,7 +2485,7 @@
{
i=doc->m_Selection->itemAt(0);
HaveItem=true;
- EditShape->setEnabled(!i->locked());
+ EditShape->setEnabled(!i->locked() && !i->sizeLocked());
SCustom->setEnabled(nr!=5 && nr!=7 && nr!=8 && !i->locked());
}
else
@@ -5761,7 +5761,11 @@
Height->setPalette(pal);
Rotation->setPalette(pal);
- EditShape->setEnabled(!isLocked);
+ bool shapeEditLocked = isLocked;
+ if (HaveItem)
+ shapeEditLocked |= CurItem->sizeLocked();
+ EditShape->setEnabled(!shapeEditLocked);
+
LayerGroup->setEnabled(!isLocked);
Locked->setChecked(isLocked);
if ((HaveDoc) && (HaveItem))
@@ -5776,9 +5780,9 @@
void PropertiesPalette::setSizeLocked(bool isSizeLocked)
{
- bool b=isSizeLocked;
+ bool b = isSizeLocked;
if (HaveItem && CurItem->locked())
- b=true;
+ b = true;
Width->setReadOnly(b);
Height->setReadOnly(b);
QPalette pal(qApp->palette());
@@ -5789,6 +5793,11 @@
Width->setPalette(pal);
Height->setPalette(pal);
NoResize->setChecked(isSizeLocked);
+
+ bool shapeEditLocked = isSizeLocked;
+ if (HaveItem)
+ shapeEditLocked |= CurItem->locked();
+ EditShape->setEnabled(!shapeEditLocked);
}
void PropertiesPalette::setPrintingEnabled(bool isPrintingEnabled)
Modified: branches/Version135/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16889&path=/branches/Version135/Scribus/scribus/scribus.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/scribus.cpp (original)
+++ branches/Version135/Scribus/scribus/scribus.cpp Fri Oct 7 23:55:08 2011
@@ -1609,20 +1609,15 @@
//CB If in EditContour mode, allow contour line to be scaled with arrow keys too
if(doc->nodeEdit.isContourLine)
view->TransformPoly(10, 0, resizeBy/unitGetRatioFromIndex(doc->unitIndex()));
- else
+ else if (!currItem->sizeLocked())
{
- if (resizingsmaller)
- {
- currItem->Sizing = false;
- doc->SizeItem(currItem->width()+resizeBy, currItem->height(), currItem->ItemNr);
- }
- else
+ if (!resizingsmaller)
{
doc->MoveItem(-resizeBy, 0, currItem, false);
- currItem->moveImageXYOffsetBy(resizeBy/currItem->imageXScale(), 0);
- currItem->Sizing = false;
- doc->SizeItem(currItem->width()+resizeBy, currItem->height(), currItem->ItemNr);
+ currItem->moveImageXYOffsetBy(resizeBy / currItem->imageXScale(), 0);
}
+ currItem->Sizing = false;
+ doc->SizeItem(currItem->width() + resizeBy, currItem->height(), currItem->ItemNr);
}
}
currItem->update();
@@ -1676,20 +1671,15 @@
//CB If in EditContour mode, allow contour line to be scaled with arrow keys too
if(doc->nodeEdit.isContourLine)
view->TransformPoly(11, 0, resizeBy/unitGetRatioFromIndex(doc->unitIndex()));
- else
+ else if (!currItem->sizeLocked())
{
if (resizingsmaller)
{
doc->MoveItem(-resizeBy, 0, currItem, false);
- currItem->moveImageXYOffsetBy(resizeBy/currItem->imageXScale(), 0);
- currItem->Sizing = false;
- doc->SizeItem(currItem->width()+resizeBy, currItem->height(), currItem->ItemNr);
+ currItem->moveImageXYOffsetBy(resizeBy / currItem->imageXScale(), 0);
}
- else
- {
- currItem->Sizing = false;
- doc->SizeItem(currItem->width()+resizeBy, currItem->height(), currItem->ItemNr);
- }
+ currItem->Sizing = false;
+ doc->SizeItem(currItem->width() + resizeBy, currItem->height(), currItem->ItemNr);
}
}
currItem->update();
@@ -1743,20 +1733,15 @@
//CB If in EditContour mode, allow contour line to be scaled with arrow keys too
if(doc->nodeEdit.isContourLine)
view->TransformPoly(12, 0, resizeBy/unitGetRatioFromIndex(doc->unitIndex()));
- else
+ else if (!currItem->sizeLocked())
{
- if (resizingsmaller)
- {
- currItem->Sizing = false;
- doc->SizeItem(currItem->width(), currItem->height()+resizeBy, currItem->ItemNr);
- }
- else
+ if (!resizingsmaller)
{
doc->MoveItem(0, -resizeBy, currItem, false);
- currItem->moveImageXYOffsetBy(0, resizeBy/currItem->imageYScale());
- currItem->Sizing = false;
- doc->SizeItem(currItem->width(), currItem->height()+resizeBy, currItem->ItemNr);
+ currItem->moveImageXYOffsetBy(0, resizeBy / currItem->imageYScale());
}
+ currItem->Sizing = false;
+ doc->SizeItem(currItem->width(), currItem->height() + resizeBy, currItem->ItemNr);
}
}
currItem->update();
@@ -1810,20 +1795,15 @@
//CB If in EditContour mode, allow contour line to be scaled with arrow keys too
if(doc->nodeEdit.isContourLine)
view->TransformPoly(13, 0, resizeBy/unitGetRatioFromIndex(doc->unitIndex()));
- else
+ else if (!currItem->sizeLocked())
{
if (resizingsmaller)
{
doc->MoveItem(0, -resizeBy, currItem, false);
- currItem->moveImageXYOffsetBy(0, resizeBy/currItem->imageYScale());
- currItem->Sizing = false;
- doc->SizeItem(currItem->width(), currItem->height()+resizeBy, currItem->ItemNr);
+ currItem->moveImageXYOffsetBy(0, resizeBy / currItem->imageYScale());
}
- else
- {
- currItem->Sizing = false;
- doc->SizeItem(currItem->width(), currItem->height()+resizeBy, currItem->ItemNr);
- }
+ currItem->Sizing = false;
+ doc->SizeItem(currItem->width(), currItem->height() + resizeBy, currItem->ItemNr);
}
}
currItem->update();
More information about the scribus-commit
mailing list