r23394 by jghali - #15974: Simplify CanvasMode's setCursor() by using modeCursor() (ale)

scribus-commit scribus-commit at lists.scribus.net
Mon Dec 2 10:08:25 UTC 2019


Author: jghali
Date: Mon Dec  2 10:08:25 2019
New Revision: 23394

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23394
Log:
#15974: Simplify CanvasMode's setCursor() by using modeCursor() (ale)

Modified:
    trunk/Scribus/scribus/canvasmode.cpp

Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23394&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode.cpp	Mon Dec  2 10:08:25 2019
@@ -761,81 +761,7 @@
 
 void CanvasMode::setModeCursor()
 {
-	IconManager& im=IconManager::instance();
-	//NOTE: Merge with similar code in ScribusMainWindow::setAppMode()
-	switch (m_doc->appMode)
-	{
-		case modeDrawShapes:
-		case modeDrawArc:
-		case modeDrawSpiral:
-			m_view->setCursor(im.loadCursor("drawframe.png"));
-			break;
-		case modeDrawImage:
-			m_view->setCursor(im.loadCursor("drawimageframe.png"));
-			break;
-		case modeDrawLatex:
-			m_view->setCursor(im.loadCursor("drawlatexframe.png"));
-			break;
-		case modeDrawText:
-			m_view->setCursor(im.loadCursor("drawtextframe.png"));
-			break;
-		case modeDrawTable2:
-			m_view->setCursor(im.loadCursor("drawtable.png"));
-			break;
-		case modeDrawRegularPolygon:
-			m_view->setCursor(im.loadCursor("drawpolyline.png"));
-			break;
-		case modeDrawLine:
-		case modeDrawBezierLine:
-			m_view->setCursor(QCursor(Qt::CrossCursor));
-			break;
-		case modeDrawFreehandLine:
-			m_view->setCursor(im.loadCursor("DrawFreeLine.png", 0, 31));
-			break;
-		case modeDrawCalligraphicLine:
-			m_view->setCursor(im.loadCursor("drawcalligraphy.png", 4, 4));
-			break;
-		case modeImportObject:
-			m_view->setCursor(im.loadCursor("dragpix.png"));
-			break;
-		case modeMagnifier:
-			if (m_view->Magnify)
-				m_view->setCursor(im.loadCursor("lupez.png"));
-			else
-				m_view->setCursor(im.loadCursor("lupezm.png"));
-			break;
-		case modePanning:
-			m_view->setCursor(im.loadCursor("handc.png"));
-			break;
-		case modeEyeDropper:
-			m_view->setCursor(im.loadCursor("colorpickercursor.png", 0, 31));
-			break;
-		case modeLinkFrames:
-			m_view->setCursor(im.loadCursor("LinkTextFrame.png", 0, 31));
-			break;
-		case modeMeasurementTool:
-		case modeEditGradientVectors:
-		case modeEditMeshGradient:
-		case modeEditMeshPatch:
-		case modeEditWeldPoint:
-		case modeInsertPDFButton:
-		case modeInsertPDFRadioButton:
-		case modeInsertPDFTextfield:
-		case modeInsertPDFCheckbox:
-		case modeInsertPDFCombobox:
-		case modeInsertPDFListbox:
-		case modeInsertPDFTextAnnotation:
-		case modeInsertPDFLinkAnnotation:
-		case modeInsertPDF3DAnnotation:
-		case modeEditArc:
-		case modeEditPolygon:
-		case modeEditSpiral:
-			m_view->setCursor(QCursor(Qt::CrossCursor));
-			break;
-		default:
-			m_view->setCursor(QCursor(Qt::ArrowCursor));
-			break;
-	}
+	m_view->setCursor(modeCursor());
 }
 
 #ifdef GESTURE_FRAME_PREVIEW




More information about the scribus-commit mailing list