r25086 by craig - 16450: Bring back the ages old rotate CW/CCW 90 functions in Properties

scribus-commit scribus-commit at lists.scribus.net
Wed May 4 20:29:21 UTC 2022


Author: craig
Date: Wed May  4 20:29:21 2022
New Revision: 25086

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=25086
Log:
16450: Bring back the ages old rotate CW/CCW 90 functions in Properties
Palette

Modified:
    trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
    trunk/Scribus/scribus/ui/propertiespalette_xyz.h
    trunk/Scribus/scribus/ui/propertiespalette_xyzbase.ui

Modified: trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25086&path=/trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp	Wed May  4 20:29:21 2022
@@ -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,31 +943,89 @@
 
 void PropertiesPalette_XYZ::handleRotation()
 {
-	if (!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())
-		{
-			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();
-	}
+	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(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()
@@ -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);

Modified: trunk/Scribus/scribus/ui/propertiespalette_xyz.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25086&path=/trunk/Scribus/scribus/ui/propertiespalette_xyz.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_xyz.h	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_xyz.h	Wed May  4 20:29:21 2022
@@ -76,6 +76,8 @@
 	void handleRotation();
 	void handleFlipH();
 	void handleFlipV();
+	void handleRotateCCW();
+	void handleRotateCW();
 	void handleLower();
 	void handleRaise();
 	void handleFront();

Modified: trunk/Scribus/scribus/ui/propertiespalette_xyzbase.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25086&path=/trunk/Scribus/scribus/ui/propertiespalette_xyzbase.ui
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_xyzbase.ui	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_xyzbase.ui	Wed May  4 20:29:21 2022
@@ -319,56 +319,76 @@
       </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="1" column="3">
+        <widget class="QToolButton" name="noPrint">
+         <property name="toolTip">
+          <string>Enable or disable exporting of the object</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1">
+        <widget class="QToolButton" name="doUnGroup">
+         <property name="toolTip">
+          <string>Ungroup the selected group</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="2">
+        <widget class="QToolButton" name="flipH">
+         <property name="toolTip">
+          <string>Flip horizontally</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="3">
+        <widget class="QToolButton" name="doLock">
+         <property name="toolTip">
+          <string>Lock or unlock the object</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="4">
+        <widget class="QToolButton" name="noResize">
+         <property name="toolTip">
+          <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="flipV">
+         <property name="toolTip">
+          <string>Flip vertically</string>
+         </property>
+        </widget>
+       </item>
        <item row="0" column="0">
-        <widget class="QToolButton" name="doGroup">
-         <property name="toolTip">
-          <string>Group the selected objects</string>
+        <widget class="QToolButton" name="rotateCCW">
+         <property name="toolTip">
+          <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="doUnGroup">
-         <property name="toolTip">
-          <string>Ungroup the selected group</string>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="1">
-        <widget class="QToolButton" name="flipH">
-         <property name="toolTip">
-          <string>Flip horizontally</string>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="1">
-        <widget class="QToolButton" name="flipV">
-         <property name="toolTip">
-          <string>Flip vertically</string>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="2">
-        <widget class="QToolButton" name="doLock">
-         <property name="toolTip">
-          <string>Lock or unlock the object</string>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="2">
-        <widget class="QToolButton" name="noPrint">
-         <property name="toolTip">
-          <string>Enable or disable exporting of the object</string>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="3">
-        <widget class="QToolButton" name="noResize">
-         <property name="toolTip">
-          <string>Lock or unlock the size of the object</string>
+        <widget class="QToolButton" name="rotateCW">
+         <property name="toolTip">
+          <string>Rotate the selection alockwise by 90º</string>
+         </property>
+         <property name="text">
+          <string/>
          </property>
         </widget>
        </item>




More information about the scribus-commit mailing list