Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 25085 → Rev 25086

/trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
91,6 → 91,8
connect(widthSpin, SIGNAL(valueChanged(double)), this, SLOT(handleNewW()));
connect(heightSpin, SIGNAL(valueChanged(double)), this, SLOT(handleNewH()));
connect(rotationSpin, SIGNAL(valueChanged(double)), this, SLOT(handleRotation()));
connect(rotateCCW, SIGNAL(clicked()), this, SLOT(handleRotateCCW()));
connect(rotateCW, SIGNAL(clicked()), this, SLOT(handleRotateCW()));
connect(flipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
connect(flipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
connect(levelUp, SIGNAL(clicked()), this, SLOT(handleRaise()));
941,33 → 943,91
 
void PropertiesPalette_XYZ::handleRotation()
{
if (!m_ScMW || m_ScMW->scriptIsRunning())
if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
if (m_haveDoc && m_haveItem)
 
if (!m_userActionOn)
m_ScMW->view->startGroupTransaction(Um::Rotate, "", Um::IRotate);
if (m_doc->m_Selection->isMultipleSelection())
{
if (!m_userActionOn)
m_ScMW->view->startGroupTransaction(Um::Rotate, "", Um::IRotate);
if (m_doc->m_Selection->isMultipleSelection())
{
double gx, gy, gh, gw;
m_doc->rotateGroup((rotationSpin->value() - m_oldRotation)*(-1), m_ScMW->view->RCenter);
m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
showXY(gx, gy);
}
else
m_doc->rotateItem(rotationSpin->value()*(-1), m_item);
if (!m_userActionOn)
{
for (int i = 0; i < m_doc->m_Selection->count(); ++i)
m_doc->m_Selection->itemAt(i)->checkChanges(true);
m_ScMW->view->endGroupTransaction();
}
m_doc->changed();
m_doc->regionsChanged()->update(QRect());
m_oldRotation = rotationSpin->value();
double gx, gy, gh, gw;
m_doc->rotateGroup(m_oldRotation - rotationSpin->value(), m_ScMW->view->RCenter);
m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
showXY(gx, gy);
}
else
m_doc->rotateItem(-1.0 * rotationSpin->value(), m_item);
if (!m_userActionOn)
{
for (int i = 0; i < m_doc->m_Selection->count(); ++i)
m_doc->m_Selection->itemAt(i)->checkChanges(true);
m_ScMW->view->endGroupTransaction();
}
m_doc->changed();
m_doc->regionsChanged()->update(QRect());
m_oldRotation = rotationSpin->value();
}
 
void PropertiesPalette_XYZ::handleRotateCCW()
{
if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
 
if (!m_userActionOn)
m_ScMW->view->startGroupTransaction(Um::Rotate, "", Um::IRotate);
if (m_doc->m_Selection->isMultipleSelection())
{
double gx, gy, gh, gw;
m_doc->rotateGroup(-90.0, m_ScMW->view->RCenter);
m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
showXY(gx, gy);
}
else
{
double rr = m_item->rotation() - 90.0;
m_doc->rotateItem(rr, m_item);
}
if (!m_userActionOn)
{
for (int i = 0; i < m_doc->m_Selection->count(); ++i)
m_doc->m_Selection->itemAt(i)->checkChanges(true);
m_ScMW->view->endGroupTransaction();
}
m_doc->changed();
m_doc->regionsChanged()->update(QRect());
m_oldRotation = rotationSpin->value();
}
 
void PropertiesPalette_XYZ::handleRotateCW()
{
if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
 
if (!m_userActionOn)
m_ScMW->view->startGroupTransaction(Um::Rotate, "", Um::IRotate);
if (m_doc->m_Selection->isMultipleSelection())
{
double gx, gy, gh, gw;
m_doc->rotateGroup(90.0, m_ScMW->view->RCenter);
m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
showXY(gx, gy);
}
else
{
double rr = m_item->rotation() + 90.0;
m_doc->rotateItem(rr, m_item);
}
if (!m_userActionOn)
{
for (int i = 0; i < m_doc->m_Selection->count(); ++i)
m_doc->m_Selection->itemAt(i)->checkChanges(true);
m_ScMW->view->endGroupTransaction();
}
m_doc->changed();
m_doc->regionsChanged()->update(QRect());
m_oldRotation = rotationSpin->value();
}
 
void PropertiesPalette_XYZ::handleLower()
{
if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning())
1242,6 → 1302,9
 
flipH->setIcon(im.loadIcon("16/flip-object-horizontal.png"));
flipV->setIcon(im.loadIcon("16/flip-object-vertical.png"));
 
rotateCCW->setIcon(im.loadIcon("rotate_ccw.png"));
rotateCW->setIcon(im.loadIcon("rotate_cw.png"));
QIcon a;
a.addPixmap(im.loadPixmap("16/lock.png"), QIcon::Normal, QIcon::On);
/trunk/Scribus/scribus/ui/propertiespalette_xyz.h
76,6 → 76,8
void handleRotation();
void handleFlipH();
void handleFlipV();
void handleRotateCCW();
void handleRotateCW();
void handleLower();
void handleRaise();
void handleFront();
/trunk/Scribus/scribus/ui/propertiespalette_xyzbase.ui
319,18 → 319,18
</spacer>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_2">
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,0,0,0,0" columnminimumwidth="0,0,0,0,0">
<property name="spacing">
<number>3</number>
</property>
<item row="0" column="0">
<widget class="QToolButton" name="doGroup">
<item row="1" column="3">
<widget class="QToolButton" name="noPrint">
<property name="toolTip">
<string>Group the selected objects</string>
<string>Enable or disable exporting of the object</string>
</property>
</widget>
</item>
<item row="1" column="0">
<item row="1" column="1">
<widget class="QToolButton" name="doUnGroup">
<property name="toolTip">
<string>Ungroup the selected group</string>
337,7 → 337,7
</property>
</widget>
</item>
<item row="0" column="1">
<item row="0" column="2">
<widget class="QToolButton" name="flipH">
<property name="toolTip">
<string>Flip horizontally</string>
344,34 → 344,54
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QToolButton" name="flipV">
<item row="0" column="3">
<widget class="QToolButton" name="doLock">
<property name="toolTip">
<string>Flip vertically</string>
<string>Lock or unlock the object</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="doLock">
<item row="0" column="4">
<widget class="QToolButton" name="noResize">
<property name="toolTip">
<string>Lock or unlock the object</string>
<string>Lock or unlock the size of the object</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QToolButton" name="doGroup">
<property name="toolTip">
<string>Group the selected objects</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QToolButton" name="noPrint">
<widget class="QToolButton" name="flipV">
<property name="toolTip">
<string>Enable or disable exporting of the object</string>
<string>Flip vertically</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QToolButton" name="noResize">
<item row="0" column="0">
<widget class="QToolButton" name="rotateCCW">
<property name="toolTip">
<string>Lock or unlock the size of the object</string>
<string>Rotate the selection anti-clockwise by 90º</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QToolButton" name="rotateCW">
<property name="toolTip">
<string>Rotate the selection alockwise by 90º</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
</layout>