projects
/
synfig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a18c093
)
Change the cursor in the Transform Tool accordingly to the key(s) pressed.
author
Carlos Lopez
<genetita@gmail.com>
Sun, 9 May 2010 19:01:57 +0000
(21:01 +0200)
committer
Carlos Lopez
<genetita@gmail.com>
Sun, 9 May 2010 19:01:57 +0000
(21:01 +0200)
synfig-studio/src/gtkmm/state_normal.cpp
patch
|
blob
|
history
diff --git
a/synfig-studio/src/gtkmm/state_normal.cpp
b/synfig-studio/src/gtkmm/state_normal.cpp
index
e9667cc
..
4ea21f1
100644
(file)
--- 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(); }
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);
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()
{
void
StateNormal_Context::load_settings()
{
@@
-282,6
+304,7
@@
StateNormal_Context::key_pressed(GdkEventKey *event)
default:
break;
}
default:
break;
}
+ refresh_cursor();
return false; //Pass on the event to other handlers, just in case
}
return false; //Pass on the event to other handlers, just in case
}
@@
-305,6
+328,7
@@
StateNormal_Context::key_released(GdkEventKey *event)
default:
break;
}
default:
break;
}
+ refresh_cursor();
return false; //Pass on the event to other handlers
}
return false; //Pass on the event to other handlers
}