From: Carlos Lopez Date: Sun, 9 May 2010 19:01:57 +0000 (+0200) Subject: Change the cursor in the Transform Tool accordingly to the key(s) pressed. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=da1bd2a89e645cd52c373b82dc49ce1b92a2b721;p=synfig.git Change the cursor in the Transform Tool accordingly to the key(s) pressed. --- 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 }