diff --git a/rtgui/previewwindow.cc b/rtgui/previewwindow.cc index f3f4c4a7b..ce667a6a3 100644 --- a/rtgui/previewwindow.cc +++ b/rtgui/previewwindow.cc @@ -19,27 +19,17 @@ #include #include #include +#include -PreviewWindow::PreviewWindow () : previewHandler(NULL), mainCropWin(NULL),cCropMoving(NULL),cNormal(NULL), isMoving(false), imageArea(NULL) { +PreviewWindow::PreviewWindow () : previewHandler(NULL), mainCropWin(NULL), isMoving(false), imageArea(NULL) { rconn = signal_size_allocate().connect( sigc::mem_fun(*this, &PreviewWindow::on_resized) ); } -PreviewWindow::~PreviewWindow () { - - if( cCropMoving ) - delete cCropMoving; - if( cNormal ) - delete cNormal; - -} - void PreviewWindow::on_realize () { Gtk::DrawingArea::on_realize (); add_events(Gdk::EXPOSURE_MASK | Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::SCROLL_MASK); - cCropMoving = new Gdk::Cursor (Gdk::FLEUR); - cNormal = new Gdk::Cursor (Gdk::ARROW); } void PreviewWindow::getObservedFrameArea (int& x, int& y, int& w, int& h) { @@ -169,9 +159,9 @@ bool PreviewWindow::on_motion_notify_event (GdkEventMotion* event) { if (isMoving) mainCropWin->remoteMove ((event->x - press_x)/zoom, (event->y - press_y)/zoom); else if (inside && !moreInside) - get_window()->set_cursor (*cCropMoving); + cursorManager.setCursor (get_window(), CSClosedHand); else - get_window()->set_cursor (*cNormal); + cursorManager.setCursor (get_window(), CSArrow); return true; } @@ -196,7 +186,7 @@ bool PreviewWindow::on_button_press_event (GdkEventButton* event) { press_x = event->x; press_y = event->y; } - get_window()->set_cursor (*cCropMoving); + cursorManager.setCursor (get_window(), CSClosedHand); } return true; } @@ -208,7 +198,7 @@ bool PreviewWindow::on_button_release_event (GdkEventButton* event) { if (isMoving) { isMoving = false; - get_window()->set_cursor (*cNormal); + cursorManager.setCursor (get_window(), CSArrow); mainCropWin->remoteMoveReady (); } return true; diff --git a/rtgui/previewwindow.h b/rtgui/previewwindow.h index 63140a31b..6f963c305 100644 --- a/rtgui/previewwindow.h +++ b/rtgui/previewwindow.h @@ -34,8 +34,6 @@ class PreviewWindow : public Gtk::DrawingArea, public PreviewListener, public Cr ImageArea* imageArea; int imgX, imgY, imgW, imgH; double zoom; - Gdk::Cursor* cCropMoving; - Gdk::Cursor* cNormal; int press_x, press_y; bool isMoving; @@ -44,7 +42,6 @@ class PreviewWindow : public Gtk::DrawingArea, public PreviewListener, public Cr public: PreviewWindow (); - ~PreviewWindow (); void setPreviewHandler (PreviewHandler* ph); void setImageArea (ImageArea* ia);