r17938 by jghali - Better reflect in the gui that mouse is grabbed when in eyedropper mode
scribus-commit
scribus-commit at lists.scribus.net
Fri Dec 7 17:30:25 UTC 2012
Author: jghali
Date: Fri Dec 7 17:30:25 2012
New Revision: 17938
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17938
Log:
Better reflect in the gui that mouse is grabbed when in eyedropper mode
Modified:
trunk/Scribus/scribus/canvasmode.cpp
trunk/Scribus/scribus/canvasmode.h
trunk/Scribus/scribus/canvasmode_eyedropper.cpp
Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17938&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Fri Dec 7 17:30:25 2012
@@ -673,6 +673,83 @@
p->restore();
}
+QCursor CanvasMode::modeCursor()
+{
+ QCursor cursor;
+ switch (m_doc->appMode)
+ {
+ case modeDrawShapes:
+ case modeDrawArc:
+ case modeDrawSpiral:
+ cursor = QCursor(loadIcon("DrawFrame.xpm"));
+ break;
+ case modeDrawImage:
+ cursor = QCursor(loadIcon("DrawImageFrame.xpm"));
+ break;
+ case modeDrawLatex:
+ cursor = QCursor(loadIcon("DrawLatexFrame.xpm"));
+ break;
+ case modeDrawText:
+ cursor = QCursor(loadIcon("DrawTextFrame.xpm"));
+ break;
+ case modeDrawTable2:
+ cursor = QCursor(loadIcon("DrawTable.xpm"));
+ break;
+ case modeDrawRegularPolygon:
+ cursor = QCursor(loadIcon("DrawPolylineFrame.xpm"));
+ break;
+ case modeDrawLine:
+ case modeDrawBezierLine:
+ cursor = QCursor(Qt::CrossCursor);
+ break;
+ case modeDrawFreehandLine:
+ cursor = QCursor(loadIcon("DrawFreeLine.png"), 0, 31);
+ break;
+ case modeDrawCalligraphicLine:
+ cursor = QCursor(loadIcon("DrawCalligraphy.xpm"), 4, 4);
+ break;
+ case modeImportObject:
+ cursor = QCursor(loadIcon("DragPix.xpm"));
+ break;
+ case modeMagnifier:
+ if (m_view->Magnify)
+ cursor = QCursor(loadIcon("LupeZ.xpm"));
+ else
+ cursor = QCursor(loadIcon("LupeZm.xpm"));
+ break;
+ case modePanning:
+ cursor = QCursor(loadIcon("HandC.xpm"));
+ break;
+ case modeEyeDropper:
+ cursor = QCursor(loadIcon("colorpickercursor.png"), 0, 31);
+ break;
+ case modeLinkFrames:
+ cursor = QCursor(loadIcon("LinkTextFrame.png"), 0, 31);
+ break;
+ case modeMeasurementTool:
+ case modeEditGradientVectors:
+ case modeEditMeshGradient:
+ case modeEditMeshPatch:
+ case modeEditWeldPoint:
+ case modeInsertPDFButton:
+ case modeInsertPDFTextfield:
+ case modeInsertPDFCheckbox:
+ case modeInsertPDFCombobox:
+ case modeInsertPDFListbox:
+ case modeInsertPDFTextAnnotation:
+ case modeInsertPDFLinkAnnotation:
+ case modeInsertPDF3DAnnotation:
+ case modeEditArc:
+ case modeEditPolygon:
+ case modeEditSpiral:
+ cursor = QCursor(Qt::CrossCursor);
+ break;
+ default:
+ cursor = QCursor(Qt::ArrowCursor);
+ break;
+ }
+ return cursor;
+}
void CanvasMode::setModeCursor()
{
Modified: trunk/Scribus/scribus/canvasmode.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17938&path=/trunk/Scribus/scribus/canvasmode.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode.h (original)
+++ trunk/Scribus/scribus/canvasmode.h Fri Dec 7 17:30:25 2012
@@ -20,10 +20,11 @@
#include "scribusapi.h"
+#include <QBrush>
+#include <QCursor>
#include <QMap>
#include <QPen>
#include <QPointF>
-#include <QBrush>
class QDragEnterEvent;
class QDragMoveEvent;
@@ -134,6 +135,8 @@
public:
void clearPixmapCache();
#endif // GESTURE_FRAME_PREVIEW
+
+ QCursor modeCursor();
void setModeCursor();
/** main canvas modes dont have a delegate */
Modified: trunk/Scribus/scribus/canvasmode_eyedropper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17938&path=/trunk/Scribus/scribus/canvasmode_eyedropper.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_eyedropper.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_eyedropper.cpp Fri Dec 7 17:30:25 2012
@@ -48,7 +48,7 @@
{
if (!m_mouseGrabbed)
{
- m_view->widget()->grabMouse();
+ m_view->widget()->grabMouse(modeCursor());
m_mouseGrabbed = true;
}
}
More information about the scribus-commit
mailing list