Module: synfig
Branch: master
Commit: da1bd2a89e645cd52c373b82dc49ce1b92a2b721
URL:    
http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig;a=commit;h=da1bd2a89e645cd52c373b82dc49ce1b92a2b721

Author: Carlos Lopez <genet...@gmail.com>
Date:   Sun May  9 21:01:57 2010 +0200

Change the cursor in the Transform Tool accordingly to the key(s) pressed.

---

 synfig-studio/src/gtkmm/state_normal.cpp |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/src/gtkmm/state_normal.cpp 
b/synfig-studio/src/gtkmm/state_normal.cpp
index e9667cc..4ea21f1 100644
--- a/synfig-studio/src/gtkmm/state_normal.cpp
+++ b/synfig-studio/src/gtkmm/state_normal.cpp
@@ -139,6 +139,7 @@ public:
        bool get_constrain_flag()const { return 
checkbutton_constrain.get_active(); }
        void set_constrain_flag(bool x) { checkbutton_constrain.set_active(x); 
refresh_constrain_flag(); }
        void refresh_constrain_flag() { 
if(duck_dragger_)duck_dragger_->constrain=get_constrain_flag(); }
+       void refresh_cursor();
 
        StateNormal_Context(CanvasView* canvas_view);
 
@@ -190,6 +191,27 @@ StateNormal::~StateNormal()
 {
 }
 
+void StateNormal_Context::refresh_cursor()
+{
+       if(get_rotate_flag() && !get_scale_flag())
+       {
+               get_work_area()->set_cursor(Gdk::EXCHANGE);
+               return;
+       }
+       if(!get_rotate_flag() && get_scale_flag())
+       {
+               get_work_area()->set_cursor(Gdk::SIZING);
+               return;
+       }
+       if(get_rotate_flag() && get_scale_flag())
+       {
+               get_work_area()->set_cursor(Gdk::CROSSHAIR);
+               return;
+       }
+       get_work_area()->set_cursor(Gdk::ARROW);
+
+}
+
 void
 StateNormal_Context::load_settings()
 {
@@ -282,6 +304,7 @@ StateNormal_Context::key_pressed(GdkEventKey *event)
                default:
                        break;
        }
+       refresh_cursor();
        return false; //Pass on the event to other handlers, just in case
 }
 
@@ -305,6 +328,7 @@ StateNormal_Context::key_released(GdkEventKey *event)
                default:
                        break;
        }
+       refresh_cursor();
        return false; //Pass on the event to other handlers
 }
 


------------------------------------------------------------------------------

_______________________________________________
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to