[haiku-commits] r42232 - haiku/trunk/src/apps/showimage

  • From: leavengood@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 18 Jun 2011 07:43:30 +0200 (CEST)

Author: leavengood
Date: 2011-06-18 07:43:29 +0200 (Sat, 18 Jun 2011)
New Revision: 42232
Changeset: https://dev.haiku-os.org/changeset/42232
Ticket: https://dev.haiku-os.org/ticket/7592

Modified:
   haiku/trunk/src/apps/showimage/ShowImageView.cpp
   haiku/trunk/src/apps/showimage/ShowImageView.h
Log:
Use grabbing cursor when moving image with the mouse.

Fixes #7592.


Modified: haiku/trunk/src/apps/showimage/ShowImageView.cpp
===================================================================
--- haiku/trunk/src/apps/showimage/ShowImageView.cpp    2011-06-18 04:46:37 UTC 
(rev 42231)
+++ haiku/trunk/src/apps/showimage/ShowImageView.cpp    2011-06-18 05:43:29 UTC 
(rev 42232)
@@ -28,6 +28,7 @@
 #include <BitmapStream.h>
 #include <Catalog.h>
 #include <Clipboard.h>
+#include <Cursor.h>
 #include <Debug.h>
 #include <Directory.h>
 #include <Entry.h>
@@ -195,7 +196,9 @@
        fShowCaption(false),
        fShowingPopUpMenu(false),
        fHideCursorCountDown(HIDE_CURSOR_DELAY_TIME),
-       fIsActiveWin(true)
+       fIsActiveWin(true),
+       fDefaultCursor(NULL),
+       fGrabCursor(NULL)
 {
        ShowImageSettings* settings = my_app->Settings();
        if (settings->Lock()) {
@@ -205,6 +208,9 @@
                settings->Unlock();
        }
 
+       fDefaultCursor = new BCursor(B_CURSOR_ID_SYSTEM_DEFAULT);
+       fGrabCursor = new BCursor(B_CURSOR_ID_GRABBING);
+
        SetViewColor(B_TRANSPARENT_COLOR);
        SetHighColor(kBorderColor);
        SetLowColor(0, 0, 0);
@@ -1115,6 +1121,7 @@
                SetMouseEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY);
                fScrollingBitmap = true;
                fFirstPoint = ConvertToScreen(position);
+               be_app->SetCursor(fGrabCursor);
        }
 }
 
@@ -1169,6 +1176,7 @@
        } else if (fScrollingBitmap) {
                _ScrollBitmap(point);
                fScrollingBitmap = false;
+               be_app->SetCursor(fDefaultCursor);
        }
        _AnimateSelection(true);
 }

Modified: haiku/trunk/src/apps/showimage/ShowImageView.h
===================================================================
--- haiku/trunk/src/apps/showimage/ShowImageView.h      2011-06-18 04:46:37 UTC 
(rev 42231)
+++ haiku/trunk/src/apps/showimage/ShowImageView.h      2011-06-18 05:43:29 UTC 
(rev 42232)
@@ -222,6 +222,9 @@
                        bool                            fIsActiveWin;
                                // Is the parent window the active window?
 
+                       BCursor*                        fDefaultCursor;
+                       BCursor*                        fGrabCursor;
+
                        image_orientation       fImageOrientation;
        static  image_orientation       fTransformation[
                                                                        
ImageProcessor


Other related posts: