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

Author: Carlos Lopez <[email protected]>
Date:   Sat May 15 14:12:50 2010 +0200

Keep the cursors of all the tools states as its default cursor except the BLine 
tool that can use the new Transform tool rotate, scale and constrain key 
combinations.
BLine tool can use the new Transform tool abilities during bline construction.

---

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

diff --git a/synfig-studio/src/gtkmm/state_normal.cpp 
b/synfig-studio/src/gtkmm/state_normal.cpp
index 4ea21f1..66c7453 100644
--- a/synfig-studio/src/gtkmm/state_normal.cpp
+++ b/synfig-studio/src/gtkmm/state_normal.cpp
@@ -193,6 +193,17 @@ StateNormal::~StateNormal()
 
 void StateNormal_Context::refresh_cursor()
 {
+       // Check the current state and return when applicable
+       synfig::String sname;
+       sname=get_canvas_view()->get_smach().get_state_name();
+       if (sname=="smooth_move"||sname=="zoom"||sname=="width" ||
+               sname=="text"||sname=="stroke"||sname=="star"||sname=="sketch"||
+               
sname=="scale"||sname=="zoom"||sname=="rotate"||sname=="rectangle"||
+               
sname=="polygon"||sname=="gradient"||sname=="fill"||sname=="draw"||
+               sname=="circle")
+                       return;
+
+       // Change the cursor based on key flags
        if(get_rotate_flag() && !get_scale_flag())
        {
                get_work_area()->set_cursor(Gdk::EXCHANGE);
@@ -208,6 +219,14 @@ void StateNormal_Context::refresh_cursor()
                get_work_area()->set_cursor(Gdk::CROSSHAIR);
                return;
        }
+       // If we are in BLine state and there is not key pressed return to
+       // the bline cursor.
+       if (sname=="bline")
+       {
+               get_work_area()->set_cursor(Gdk::CROSSHAIR);
+               return;
+       }
+       // Default cursor for Transform tool
        get_work_area()->set_cursor(Gdk::ARROW);
 
 }


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

_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to