diff options
author | David Robillard <d@drobilla.net> | 2014-12-23 13:46:53 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-12-23 13:47:59 -0500 |
commit | 62355de33a00e40c20b79d7db1ac2139fd042743 (patch) | |
tree | 252d1c251f57f8e5465bbff5a468af31a0da5f37 /gtk2_ardour/editor.h | |
parent | e00c579fb2e99e993a0ab84ff00ba3109f6b5f20 (diff) |
Fix cursor update on nested entry.
For example, if you're in a note and something about the mode changes, it's the
underlying region context that needs to change. So, seems we need a stack of
entry contexts to deal with this sort of thing.
Switching in/out of smart mode still doesn't update immediately because we
don't have the y-coordinate needed to update it.
Diffstat (limited to 'gtk2_ardour/editor.h')
-rw-r--r-- | gtk2_ardour/editor.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index ba2060748b..fbf17354d8 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -459,6 +459,19 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void get_pointer_position (double &, double &) const; + /** Context for mouse entry (stored in a stack). */ + struct EnterContext { + ItemType item_type; + boost::shared_ptr<CursorContext> cursor_ctx; + }; + + /** Get the topmost enter context for the given item type. + * + * This is used to change the cursor associated with a given enter context, + * which may not be on the top of the stack. + */ + EnterContext* get_enter_context(ItemType type); + TimeAxisView* stepping_axis_view () { return _stepping_axis_view; } @@ -735,8 +748,14 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Gdk::Cursor* which_track_cursor () const; Gdk::Cursor* which_mode_cursor () const; Gdk::Cursor* which_trim_cursor (bool left_side) const; + Gdk::Cursor* which_canvas_cursor (ItemType type) const; + + /** Push the appropriate enter/cursor context on item entry. */ void choose_canvas_cursor_on_entry (ItemType); + /** Update all enter cursors based on current settings. */ + void update_all_enter_cursors (); + ArdourCanvas::GtkCanvas* _track_canvas; ArdourCanvas::GtkCanvasViewport* _track_canvas_viewport; @@ -1098,7 +1117,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD framecnt_t cut_buffer_length; boost::shared_ptr<CursorContext> _press_cursor_ctx; ///< Button press cursor context - boost::shared_ptr<CursorContext> _enter_cursor_ctx; ///< Entered item cursor context boost::weak_ptr<ARDOUR::Trimmable> _trimmable; boost::weak_ptr<ARDOUR::Movable> _movable; @@ -1981,7 +1999,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD */ RegionView* entered_regionview; - ItemType _entered_item_type; + std::vector<EnterContext> _enter_stack; bool clear_entered_track; bool left_track_canvas (GdkEventCrossing*); |