diff --git a/rtdata/images/move-1D-h.png b/rtdata/images/move-1D-h.png new file mode 100644 index 000000000..44babcfb4 Binary files /dev/null and b/rtdata/images/move-1D-h.png differ diff --git a/rtdata/images/move-1D-v.png b/rtdata/images/move-1D-v.png new file mode 100644 index 000000000..cbc1c7e68 Binary files /dev/null and b/rtdata/images/move-1D-v.png differ diff --git a/rtdata/images/move-2D.png b/rtdata/images/move-2D.png new file mode 100644 index 000000000..27e7c1e67 Binary files /dev/null and b/rtdata/images/move-2D.png differ diff --git a/rtdata/images/move-rotate.png b/rtdata/images/move-rotate.png new file mode 100644 index 000000000..70309972b Binary files /dev/null and b/rtdata/images/move-rotate.png differ diff --git a/rtgui/cursormanager.cc b/rtgui/cursormanager.cc index 99bdb6701..a625c7adc 100644 --- a/rtgui/cursormanager.cc +++ b/rtgui/cursormanager.cc @@ -44,11 +44,19 @@ void CursorManager::init (Glib::RefPtr mainWin) { Glib::RefPtr close_hand = safe_create_from_file("closedhand.png"); Glib::RefPtr wbpick = safe_create_from_file("gtk-color-picker-small.png"); Glib::RefPtr empty = safe_create_from_file("empty.png"); - + Glib::RefPtr move2D = safe_create_from_file("move-2D.png"); + Glib::RefPtr move1DH = safe_create_from_file("move-1D-h.png"); + Glib::RefPtr move1DV = safe_create_from_file("move-1D-v.png"); + Glib::RefPtr moveRotate = safe_create_from_file("move-rotate.png"); + cHand = hand ? new Gdk::Cursor (cAdd->get_display(), hand, 10, 10) : new Gdk::Cursor (Gdk::HAND2); cClosedHand = close_hand ? new Gdk::Cursor (cAdd->get_display(), close_hand, 10, 10) : new Gdk::Cursor (Gdk::HAND2); cWB = wbpick ? new Gdk::Cursor (cAdd->get_display(), wbpick, 1, 12) : new Gdk::Cursor (Gdk::ARROW); cHidden = empty ? new Gdk::Cursor (cAdd->get_display(), empty, 12, 12) : new Gdk::Cursor (Gdk::FLEUR); + cMove2D = move2D ? new Gdk::Cursor (cAdd->get_display(), move2D, 11, 11) : new Gdk::Cursor (Gdk::FLEUR); + cMove1DH = move1DH ? new Gdk::Cursor (cAdd->get_display(), move1DH, 11, 11) : new Gdk::Cursor (Gdk::FLEUR); + cMove1DV = move1DV ? new Gdk::Cursor (cAdd->get_display(), move1DV, 11, 11) : new Gdk::Cursor (Gdk::FLEUR); + cMoveRotate = moveRotate ? new Gdk::Cursor (cAdd->get_display(), moveRotate, 11, 11) : new Gdk::Cursor (Gdk::CIRCLE); mainWindow = mainWin; } @@ -57,7 +65,7 @@ void CursorManager::init (Glib::RefPtr mainWin) { void CursorManager::setCursor (Glib::RefPtr window, CursorShape shape) { if (shape==CSArrow) - // set_cursor without any arguments to select system default + // set_cursor without any arguments to select system default window->set_cursor (); else if (shape==CSOpenHand) window->set_cursor (*cHand); @@ -79,6 +87,14 @@ void CursorManager::setCursor (Glib::RefPtr window, CursorShape sha window->set_cursor (*cResizeBottomLeft); else if (shape==CSResizeBottomRight) window->set_cursor (*cResizeBottomRight); + else if (shape==CSMove2D) + window->set_cursor (*cMove2D); + else if (shape==CSMove1DH) + window->set_cursor (*cMove1DH); + else if (shape==CSMove1DV) + window->set_cursor (*cMove1DV); + else if (shape==CSMoveRotate) + window->set_cursor (*cMoveRotate); else if (shape==CSSpotWB) window->set_cursor (*cWB); else if (shape==CSCropSelect) diff --git a/rtgui/cursormanager.h b/rtgui/cursormanager.h index 19b024155..1302708c7 100644 --- a/rtgui/cursormanager.h +++ b/rtgui/cursormanager.h @@ -25,13 +25,14 @@ enum CursorShape { CSArrow, CSOpenHand, CSClosedHand, CSMove, CSMoveLeft, CSMoveRight, CSResizeWidth, CSResizeHeight, CSResizeDiagonal, CSResizeTopLeft, CSResizeTopRight, CSResizeBottomLeft, CSResizeBottomRight, + CSMove2D, CSMove1DH, CSMove1DV, CSMoveRotate, CSSpotWB, CSCropSelect, CSStraighten, CSPlus, CSWait, CSEmpty }; class CursorManager { protected: - Gdk::Cursor* cResizeWidth; + Gdk::Cursor* cResizeWidth; Gdk::Cursor* cResizeHeight; Gdk::Cursor* cResizeDiag; Gdk::Cursor* cResizeTopLeft; @@ -50,6 +51,10 @@ class CursorManager { Gdk::Cursor* cClosedHand; Gdk::Cursor* cWB; Gdk::Cursor* cHidden; + Gdk::Cursor* cMove2D; + Gdk::Cursor* cMove1DH; + Gdk::Cursor* cMove1DV; + Gdk::Cursor* cMoveRotate; Glib::RefPtr mainWindow; public: diff --git a/rtgui/gradient.cc b/rtgui/gradient.cc index 177b19668..dacba208d 100644 --- a/rtgui/gradient.cc +++ b/rtgui/gradient.cc @@ -310,12 +310,24 @@ void Gradient::editToggled () { unsubscribe(); } -// TODO CursorShape Gradient::getCursor(int objectID) { - EditDataProvider* editProvider = getEditProvider(); - if (editProvider->object >= 0 || editProvider->object<=2) - return CSMove; - return CSOpenHand; + switch (objectID) { + case (0): + case (1): + return CSMoveRotate; + case (2): + case (3): + { + int angle = degree->getIntValue(); + if (angle<-135 || (angle>=-45 && angle<=45) || angle>135) + return CSMove1DV; + return CSMove1DH; + } + case (4): + return CSMove2D; + default: + return CSOpenHand; + } } bool Gradient::mouseOver(int modifierKey) { diff --git a/tools/source_icons/scalable/move-1D-h.svg b/tools/source_icons/scalable/move-1D-h.svg new file mode 100644 index 000000000..64514eed1 --- /dev/null +++ b/tools/source_icons/scalable/move-1D-h.svg @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/tools/source_icons/scalable/move-1D-v.svg b/tools/source_icons/scalable/move-1D-v.svg new file mode 100644 index 000000000..24b49a7de --- /dev/null +++ b/tools/source_icons/scalable/move-1D-v.svg @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/tools/source_icons/scalable/move-2D.svg b/tools/source_icons/scalable/move-2D.svg new file mode 100644 index 000000000..bb0eece8f --- /dev/null +++ b/tools/source_icons/scalable/move-2D.svg @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/tools/source_icons/scalable/rotate-move.svg b/tools/source_icons/scalable/rotate-move.svg new file mode 100644 index 000000000..362803b65 --- /dev/null +++ b/tools/source_icons/scalable/rotate-move.svg @@ -0,0 +1,301 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + +