From 871188a1d86290e701bdf4b9940ae9aa6b2bd3c6 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Mon, 20 Aug 2018 10:44:27 +0200 Subject: [PATCH] Navigator should use a different icon while panning The Navigator uses the same hand icon regardless whether panning the red square or not, this branch tries to fix that, #4738 Includes a cleanup of icon names, i.e. the crosshair should not be called the hand. --- .../themed/png/dark/hand-open-hicontrast.png | Bin 0 -> 772 bytes .../themed/png/light/hand-open-hicontrast.png | Bin 0 -> 772 bytes .../themed/svg/hand-open-hicontrast.svg | 126 ++++++++++++++++++ rtgui/cropwindow.cc | 4 +- rtgui/cursormanager.cc | 24 ++-- rtgui/cursormanager.h | 36 ++++- rtgui/curveeditor.cc | 2 +- rtgui/edit.cc | 2 +- rtgui/edit.h | 2 +- rtgui/gradient.cc | 2 +- rtgui/previewwindow.cc | 7 +- 11 files changed, 179 insertions(+), 26 deletions(-) create mode 100644 rtdata/images/themed/png/dark/hand-open-hicontrast.png create mode 100644 rtdata/images/themed/png/light/hand-open-hicontrast.png create mode 100644 rtdata/images/themed/svg/hand-open-hicontrast.svg diff --git a/rtdata/images/themed/png/dark/hand-open-hicontrast.png b/rtdata/images/themed/png/dark/hand-open-hicontrast.png new file mode 100644 index 0000000000000000000000000000000000000000..2ee26e3751ae13e65e27a7050edf7a877a4b1c82 GIT binary patch literal 772 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaA1(mo)lsM-XR2F5XXOu8FJ1aPr zloVwqm6l}Y=jjG#Bo?JQ=4584DrA(D6jnBy}7ANYP=o#oA4oPAKnl1}6-6gd+xhS&$WFSLOVtGhLYEfcAYN|qJa(lV!_B$IXpd!u!kH}&M2EHR8%s5q>PZ}t=G{7gs)xE$6$OHmzFaRBpFW*Fefsj{%YXm=y?OKIJ9q9}yLN5cwr#oL??5r4SrX(I%)rd~;)CAj zf1kfj{^l|N-xXoo=$y}`%Yu*m+bQ?s$LD+1o&SD(`2FwkwONn9+yJ_i#nZ(xMB{wy zq~}G=1_CXbPOVu{48iO<>h9&9_x@irlAGZ8#{R9j^4nK_lgyT0^tAG_e%;m96ZB2j zm*L~t6@O%y_O6g+ob$fwH@lOe}9&5C&f?}?FL|mSO+g}fj zKNAyGc7&IgzchWoQ1wabw8~c+=dri2cwQ^&G^l?r)l5w z#<|;ESEiiRZkWBbNuW8_?bQLt#B~mV(H;ed{&t?UnJ8JZ;pD$to1%^-Gf&UBZhg+a z?)W$7znBy}7ANYP=o#oA4oPAKnl1}6-6gd+xhS&$WFSLOVtGhLYEfcAYN|qJa(lV!_B$IXpd!u!kH}&M2EHR8%s5q>PZ}t=G{7gs)xE$6$OHmzFaRBpFW*Fefsj{%YXm=y?OKIJ9q9}yLN5cwr#oL??5r4SrX(I%)rd~;)CAj zf1kfj{^l|N-xXoo=$y}`%Yu*m+bQ?s$LD+1o&SD(`2FwkwONn9+yJ_i#nZ(xMB{wy zq~}G=1_CXbPOVu{48iO<>h9&9_x@irlAGZ8#{R9j^4nK_lgyT0^tAG_e%;m96ZB2j zm*L~t6@O%y_O6g+ob$fwH@lOe}9&5C&f?}?FL|mSO+g}fj zKNAyGc7&IgzchWoQ1wabw8~c+=dri2cwQ^&G^l?r)l5w z#<|;ESEiiRZkWBbNuW8_?bQLt#B~mV(H;ed{&t?UnJ8JZ;pD$to1%^-Gf&UBZhg+a z?)W$7z + + + + + + + + + + + image/svg+xml + + + + + Maciej Dworak + + + + + + + + RawTherapee icon. + + + + + + + + + + + + + + + + + + + diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index 77118277c..2b3e7f342 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -1251,7 +1251,7 @@ void CropWindow::updateCursor (int x, int y) if (onArea (CropObserved, x, y)) { newType = CSMove; } else { - newType = CSOpenHand; + newType = CSHandOpen; } } else if (tm == TMSpotWB) { newType = CSSpotWB; @@ -1284,7 +1284,7 @@ void CropWindow::updateCursor (int x, int y) } else if (state == SCropMove || state == SCropWinMove || state == SObservedMove) { newType = CSMove; } else if (state == SHandMove || state == SCropImgMove) { - newType = CSClosedHand; + newType = CSHandClosed; } else if (state == SResizeW1 || state == SResizeW2) { newType = CSResizeWidth; } else if (state == SResizeH1 || state == SResizeH2) { diff --git a/rtgui/cursormanager.cc b/rtgui/cursormanager.cc index 6c280ee8c..57805939a 100644 --- a/rtgui/cursormanager.cc +++ b/rtgui/cursormanager.cc @@ -51,8 +51,9 @@ void CursorManager::init (Glib::RefPtr mainWindow) cAdd = Gdk::Cursor::create (display, Gdk::PLUS); cWait = Gdk::Cursor::create (display, Gdk::CLOCK); - Glib::RefPtr hand = RTImage::createFromFile ("crosshair-hicontrast.png"); - Glib::RefPtr close_hand = RTImage::createFromFile ("hand-closed-hicontrast.png"); + Glib::RefPtr crosshair = RTImage::createFromFile ("crosshair-hicontrast.png"); + Glib::RefPtr hand_open = RTImage::createFromFile ("hand-open-hicontrast.png"); + Glib::RefPtr hand_closed = RTImage::createFromFile ("hand-closed-hicontrast.png"); Glib::RefPtr wbpick = RTImage::createFromFile ("color-picker-hicontrast.png"); Glib::RefPtr cpick = RTImage::createFromFile ("color-picker-add-hicontrast.png"); Glib::RefPtr empty = RTImage::createFromFile ("empty.png"); @@ -61,8 +62,9 @@ void CursorManager::init (Glib::RefPtr mainWindow) Glib::RefPtr move1DV = RTImage::createFromFile ("node-move-y-hicontrast.png"); Glib::RefPtr moveRotate = RTImage::createFromFile ("rotate-aroundnode-hicontrast.png"); - cHand = hand ? Gdk::Cursor::create (cAdd->get_display(), hand, 12, 12) : Gdk::Cursor::create (cAdd->get_display(), Gdk::HAND2); - cClosedHand = close_hand ? Gdk::Cursor::create (cAdd->get_display(), close_hand, 12, 12) : Gdk::Cursor::create (cAdd->get_display(), Gdk::HAND2); + cCrosshair = crosshair ? Gdk::Cursor::create (cAdd->get_display(), crosshair, 12, 12) : Gdk::Cursor::create (cAdd->get_display(), Gdk::HAND2); + cHandOpen = hand_open ? Gdk::Cursor::create (cAdd->get_display(), hand_open, 12, 12) : Gdk::Cursor::create (cAdd->get_display(), Gdk::HAND2); + cHandClosed = hand_closed ? Gdk::Cursor::create (cAdd->get_display(), hand_closed, 12, 12) : Gdk::Cursor::create (cAdd->get_display(), Gdk::HAND2); cWB = wbpick ? Gdk::Cursor::create (cAdd->get_display(), wbpick, 4, 21) : Gdk::Cursor::create (cAdd->get_display(), Gdk::ARROW); cAddPicker = cpick ? Gdk::Cursor::create (cAdd->get_display(), cpick, 4, 21) : Gdk::Cursor::create (cAdd->get_display(), Gdk::ARROW); cHidden = empty ? Gdk::Cursor::create (cAdd->get_display(), empty, 12, 12) : Gdk::Cursor::create (cAdd->get_display(), Gdk::FLEUR); @@ -82,10 +84,12 @@ void CursorManager::setCursor (Glib::RefPtr window, CursorShape sha // set_cursor without any arguments to select system default { window->set_cursor (); - } else if (shape == CSOpenHand) { - window->set_cursor (cHand); - } else if (shape == CSClosedHand) { - window->set_cursor (cClosedHand); + } else if (shape == CSCrosshair) { + window->set_cursor (cCrosshair); + } else if (shape == CSHandOpen) { + window->set_cursor (cHandOpen); + } else if (shape == CSHandClosed) { + window->set_cursor (cHandClosed); } else if (shape == CSMove) { window->set_cursor (cCropMove); } else if (shape == CSResizeWidth) { @@ -115,13 +119,13 @@ void CursorManager::setCursor (Glib::RefPtr window, CursorShape sha } else if (shape == CSAddColPicker) { window->set_cursor (cAddPicker); } else if (shape == CSCropSelect) { - window->set_cursor (cHand); + window->set_cursor (cCrosshair); } else if (shape == CSMoveLeft) { window->set_cursor (cLeftTanMove); } else if (shape == CSMoveRight) { window->set_cursor (cRightTanMove); } else if (shape == CSStraighten) { - window->set_cursor (cHand); + window->set_cursor (cCrosshair); } else if (shape == CSWait) { window->set_cursor (cWait); } else if (shape == CSPlus) { diff --git a/rtgui/cursormanager.h b/rtgui/cursormanager.h index fcd856509..c48648931 100644 --- a/rtgui/cursormanager.h +++ b/rtgui/cursormanager.h @@ -22,11 +22,32 @@ #include enum CursorShape { - CSUndefined, CSArrow, CSOpenHand, CSClosedHand, CSMove, CSMoveLeft, - CSMoveRight, CSResizeWidth, CSResizeHeight, CSResizeDiagonal, - CSResizeTopLeft, CSResizeTopRight, CSResizeBottomLeft, CSResizeBottomRight, - CSMove2D, CSMove1DH, CSMove1DV, CSMoveRotate, - CSSpotWB, CSAddColPicker, CSCropSelect, CSStraighten, CSPlus, CSWait, CSEmpty + CSUndefined, + CSArrow, + CSCrosshair, + CSHandOpen, + CSHandClosed, + CSMove, + CSMoveLeft, + CSMoveRight, + CSResizeWidth, + CSResizeHeight, + CSResizeDiagonal, + CSResizeTopLeft, + CSResizeTopRight, + CSResizeBottomLeft, + CSResizeBottomRight, + CSMove2D, + CSMove1DH, + CSMove1DV, + CSMoveRotate, + CSSpotWB, + CSAddColPicker, + CSCropSelect, + CSStraighten, + CSPlus, + CSWait, + CSEmpty }; class CursorManager @@ -48,8 +69,9 @@ private: Glib::RefPtr cCropSelection; Glib::RefPtr cAdd; Glib::RefPtr cWait; - Glib::RefPtr cHand; - Glib::RefPtr cClosedHand; + Glib::RefPtr cCrosshair; + Glib::RefPtr cHandOpen; + Glib::RefPtr cHandClosed; Glib::RefPtr cWB; Glib::RefPtr cAddPicker; Glib::RefPtr cHidden; diff --git a/rtgui/curveeditor.cc b/rtgui/curveeditor.cc index 8b319ecbe..a65f8b451 100644 --- a/rtgui/curveeditor.cc +++ b/rtgui/curveeditor.cc @@ -443,5 +443,5 @@ CursorShape CurveEditor::getCursor(const int objectID) return CSResizeHeight; } - return CSOpenHand; + return CSHandOpen; } diff --git a/rtgui/edit.cc b/rtgui/edit.cc index 9ee0d63ba..e68fec15c 100644 --- a/rtgui/edit.cc +++ b/rtgui/edit.cc @@ -1140,7 +1140,7 @@ CursorShape EditDataProvider::getCursor(int objectID) currSubscriber->getCursor(objectID); } - return CSOpenHand; + return CSHandOpen; } EditSubscriber* EditDataProvider::getCurrSubscriber() diff --git a/rtgui/edit.h b/rtgui/edit.h index c6878c54a..611d95e1c 100644 --- a/rtgui/edit.h +++ b/rtgui/edit.h @@ -717,7 +717,7 @@ inline EditDataProvider* EditSubscriber::getEditProvider () { } inline CursorShape EditSubscriber::getCursor (const int objectID) { - return CSOpenHand; + return CSHandOpen; } inline bool EditSubscriber::mouseOver (const int modifierKey) { diff --git a/rtgui/gradient.cc b/rtgui/gradient.cc index 88e67adb3..40c9f01ab 100644 --- a/rtgui/gradient.cc +++ b/rtgui/gradient.cc @@ -346,7 +346,7 @@ CursorShape Gradient::getCursor(const int objectID) return CSMove2D; default: - return CSOpenHand; + return CSHandOpen; } } diff --git a/rtgui/previewwindow.cc b/rtgui/previewwindow.cc index 06ce3ad18..5c7cce997 100644 --- a/rtgui/previewwindow.cc +++ b/rtgui/previewwindow.cc @@ -230,8 +230,9 @@ bool PreviewWindow::on_motion_notify_event (GdkEventMotion* event) mainCropWin->remoteMove ((event->x - press_x) / zoom, (event->y - press_y) / zoom); press_x = event->x; press_y = event->y; + newType = CSHandClosed; } else if (inside) { - newType = CSClosedHand; + newType = CSHandOpen; } else { newType = CSArrow; } @@ -262,8 +263,8 @@ bool PreviewWindow::on_button_press_event (GdkEventButton* event) press_x = event->x; press_y = event->y; - if (cursor_type != CSClosedHand) { - cursor_type = CSClosedHand; + if (cursor_type != CSHandClosed) { + cursor_type = CSHandClosed; CursorManager::setWidgetCursor(get_window(), cursor_type); } }