r19817 by craig - #12870: Jump to image/item top let rather than page

scribus-commit scribus-commit at lists.scribus.net
Thu Feb 12 14:22:53 UTC 2015


Author: craig
Date: Thu Feb 12 14:22:53 2015
New Revision: 19817

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19817
Log:
#12870: Jump to image/item top let rather than page

Modified:
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribus.h
    trunk/Scribus/scribus/ui/outlinepalette.cpp
    trunk/Scribus/scribus/ui/picstatus.cpp
    trunk/Scribus/scribus/ui/picstatus.h

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19817&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Thu Feb 12 14:22:53 2015
@@ -6318,7 +6318,7 @@
 		view->requestMode(modeEditTable);
 }
 
-void ScribusMainWindow::selectItemsFromOutlines(PageItem* ite, bool single)
+void ScribusMainWindow::selectItemsFromOutlines(PageItem* ite, bool single, int position)
 {
 	if (HaveDoc && doc->appMode == modeEditClip)
 		view->requestMode(submodeEndNodeEdit);
@@ -6350,7 +6350,18 @@
 		}
 		else
 		{
-			view->SetCCPo(currItem->xPos() + currItem->width() / 2.0, currItem->yPos() + currItem->height() / 2.0);
+			double xOffset=0.0,yOffset=0.0;
+			switch (position)
+			{
+				case 1: //top left
+					break;
+				default: //center
+					xOffset = currItem->width() / 2.0;
+					yOffset = currItem->height() / 2.0;
+					break;
+			}
+
+			view->SetCCPo(currItem->xPos() + xOffset, currItem->yPos() + yOffset);
 		}
 	}
 }
@@ -7753,19 +7764,17 @@
 
 void ScribusMainWindow::StatusPic()
 {
-	if (HaveDoc)
-	{
-		PicStatus *dia = new PicStatus(this, doc);
-		connect(dia, SIGNAL(selectPage(int)), this, SLOT(selectPagesFromOutlines(int)));
-		connect(dia, SIGNAL(selectMasterPage(QString)), this, SLOT(editMasterPagesStart(QString)));
-		connect(dia, SIGNAL(selectElementByItem(PageItem *, bool)), this, SLOT(selectItemsFromOutlines(PageItem *, bool)));
-		dia->exec();
-		delete dia;
-	}
-}
-
-QString ScribusMainWindow::CFileDialog(QString wDir, QString caption, QString filter, QString defNa,
-                                int optionFlags, bool *docom, bool *doFont, bool *doProfiles)
+	if (!HaveDoc)
+		return;
+	PicStatus *dia = new PicStatus(this, doc);
+	connect(dia, SIGNAL(selectPage(int)), this, SLOT(selectPagesFromOutlines(int)));
+	connect(dia, SIGNAL(selectMasterPage(QString)), this, SLOT(editMasterPagesStart(QString)));
+	connect(dia, SIGNAL(selectElementByItem(PageItem *, bool, int )), this, SLOT(selectItemsFromOutlines(PageItem *, bool, int)));
+	dia->exec();
+	delete dia;
+}
+
+QString ScribusMainWindow::CFileDialog(QString wDir, QString caption, QString filter, QString defNa, int optionFlags, bool *docom, bool *doFont, bool *doProfiles)
 {
 	QString retval("");
 	// changed from "this" to qApp->activeWindow() to be sure it will be opened

Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19817&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h (original)
+++ trunk/Scribus/scribus/scribus.h Thu Feb 12 14:22:53 2015
@@ -491,7 +491,8 @@
 	void setNewCharStyle(const QString& name);
 	void setAlignmentValue(int a);
 	void editItemsFromOutlines(PageItem *ite);
-	void selectItemsFromOutlines(PageItem *ite, bool single = false);
+	//0= center, 1 = top left.
+	void selectItemsFromOutlines(PageItem *ite, bool single = false, int position = 0);
 	void selectItemFromOutlines(PageItem *ite, bool single, int cPos);
 	void selectPagesFromOutlines(int ScPage);
 	void doPrintPreview();

Modified: trunk/Scribus/scribus/ui/outlinepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19817&path=/trunk/Scribus/scribus/ui/outlinepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/outlinepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/outlinepalette.cpp Thu Feb 12 14:22:53 2015
@@ -226,7 +226,7 @@
 		else
 		{
 			item->PageItemObject->OwnPage = item->DocObject->OnPage(item->PageItemObject);
-			item->DocObject->scMW()->selectItemsFromOutlines(item->PageItemObject, true);
+			item->DocObject->scMW()->selectItemsFromOutlines(item->PageItemObject, true, 1);
 		}
 		QList<QTreeWidgetItem*> selList;
 		selList.append(it);

Modified: trunk/Scribus/scribus/ui/picstatus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19817&path=/trunk/Scribus/scribus/ui/picstatus.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/picstatus.cpp (original)
+++ trunk/Scribus/scribus/ui/picstatus.cpp Thu Feb 12 14:22:53 2015
@@ -394,15 +394,17 @@
 
 void PicStatus::GotoPic()
 {
-	if (currItem != NULL)
-	{
-		if (currItem->OnMasterPage.isEmpty() && m_Doc->masterPageMode())
-			ScCore->primaryMainWindow()->closeActiveWindowMasterPageEditor();
-		if (!currItem->OnMasterPage.isEmpty())
-			emit selectMasterPage(currItem->OnMasterPage);
-		else
-			emit selectPage(currItem->OwnPage);
-	}
+	if (currItem == NULL)
+		return;
+
+	if (currItem->OnMasterPage.isEmpty() && m_Doc->masterPageMode())
+		ScCore->primaryMainWindow()->closeActiveWindowMasterPageEditor();
+	if (!currItem->OnMasterPage.isEmpty())
+		emit selectMasterPage(currItem->OnMasterPage);
+	else
+		emit selectPage(currItem->OwnPage);
+
+	emit selectElementByItem(currItem, true, 1);
 }
 
 void PicStatus::SelectPic()
@@ -415,7 +417,7 @@
 	else if (!currItem->OnMasterPage.isEmpty() && !m_Doc->masterPageMode())
 		emit selectMasterPage(currItem->OnMasterPage);
 
-	emit selectElementByItem(currItem, true);
+	emit selectElementByItem(currItem, true, 1);
 }
 
 bool PicStatus::loadPict(const QString & newFilePath)

Modified: trunk/Scribus/scribus/ui/picstatus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19817&path=/trunk/Scribus/scribus/ui/picstatus.h
==============================================================================
--- trunk/Scribus/scribus/ui/picstatus.h (original)
+++ trunk/Scribus/scribus/ui/picstatus.h Thu Feb 12 14:22:53 2015
@@ -86,7 +86,7 @@
 signals:
 	void selectPage(int);
 	void selectMasterPage(QString);
-	void selectElementByItem(PageItem *, bool);
+	void selectElementByItem(PageItem *, bool, int);
 	void refreshItem(PageItem*);
 
 protected:




More information about the scribus-commit mailing list