diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-09-22 15:21:06 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-09-22 15:21:06 +0000 |
commit | ded4a143db069785aa33eeb6dc9da02770e3ae8e (patch) | |
tree | d1a2b94e11a4fe4a1d173e7972414cc16ecee7fd /gtk2_ardour/editor_canvas.cc | |
parent | d4aaa9c10cd21ef7e1b0f5509963b57c2465302b (diff) |
much craziness with canvas cursors; fix 0 beat cursor text when shortening notes; fix crash when trimming locked regions; don't show trim cursors when region is locked; partial version of enumwriter validation fix from 2.X (less necessary with 3.0; probably more ...
git-svn-id: svn://localhost/ardour2/branches/3.0@7831 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_canvas.cc')
-rw-r--r-- | gtk2_ardour/editor_canvas.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index faf2c7e19e..7da1464bf8 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -426,7 +426,7 @@ bool Editor::track_canvas_map_handler (GdkEventAny* /*ev*/) { if (current_canvas_cursor) { - track_canvas->get_window()->set_cursor (*current_canvas_cursor); + set_canvas_cursor (current_canvas_cursor); } return false; } @@ -568,7 +568,7 @@ Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert) } } - if ((autoscroll_x != last_autoscroll_x) || (autoscroll_y != last_autoscroll_y) || (autoscroll_x == 0 && autoscroll_y == 0)) { + if (autoscroll_active && ((autoscroll_x != last_autoscroll_x) || (autoscroll_y != last_autoscroll_y) || (autoscroll_x == 0 && autoscroll_y == 0))) { stop_canvas_autoscroll (); } @@ -918,12 +918,15 @@ Editor::horizontal_position () const return frame_to_unit (leftmost_frame); } void -Editor::set_canvas_cursor (Gdk::Cursor* cursor) +Editor::set_canvas_cursor (Gdk::Cursor* cursor, bool save) { + if (save) { + current_canvas_cursor = cursor; + } + if (is_drawable()) { - track_canvas->get_window()->set_cursor(*cursor); + track_canvas->get_window()->set_cursor (*cursor); } - } bool @@ -931,7 +934,7 @@ Editor::track_canvas_key_press (GdkEventKey* event) { /* XXX: event does not report the modifier key pressed down, AFAICS, so use the Keyboard object instead */ if (mouse_mode == Editing::MouseZoom && Keyboard::the_keyboard().key_is_down (GDK_Control_L)) { - track_canvas->get_window()->set_cursor (*zoom_out_cursor); + set_canvas_cursor (zoom_out_cursor); } return false; @@ -941,7 +944,7 @@ bool Editor::track_canvas_key_release (GdkEventKey* event) { if (mouse_mode == Editing::MouseZoom && !Keyboard::the_keyboard().key_is_down (GDK_Control_L)) { - track_canvas->get_window()->set_cursor (*zoom_in_cursor); + set_canvas_cursor (zoom_in_cursor); } return false; |