diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-11-18 05:25:22 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-11-18 05:25:22 +0000 |
commit | 3aa7dacfdf214f0db9330d975e94b7697a0259eb (patch) | |
tree | 3bf47d7dec915ae2bb7b75f85df2618ee964ce0d /gtk2_ardour/audio_clock.cc | |
parent | 329a54d129ef436a7b7c0e82bf068719ce44cc45 (diff) |
bad first pass at a cursor for clock editing. lots to do here. cursor is not in the right place as soon as we pass a non-digit. color is hard-coded. and more. but .. hey, look, its a cursor ..
git-svn-id: svn://localhost/ardour2/branches/3.0@10671 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/audio_clock.cc')
-rw-r--r-- | gtk2_ardour/audio_clock.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc index e1e468e544..6b2f621ab0 100644 --- a/gtk2_ardour/audio_clock.cc +++ b/gtk2_ardour/audio_clock.cc @@ -280,6 +280,19 @@ AudioClock::render (cairo_t* cr) Gtkmm2ext::rounded_rectangle (cr, 0, upper_height + separator_height, _width, h, 9); } } + + if (editing) { + Pango::Rectangle cursor = _layout->get_cursor_strong_pos (edit_string.length() - input_string.length() - 1); + cerr << "index at " << edit_string.length() - input_string.length() - 1 + << " cursor at " << cursor.get_x()/PANGO_SCALE << ", " << cursor.get_y()/PANGO_SCALE + << " " << cursor.get_width()/PANGO_SCALE + << " .. " << cursor.get_height()/PANGO_SCALE + << endl; + cairo_set_source_rgba (cr, 0.9, 0.1, 0.1, 0.3); + cairo_rectangle (cr, 6 + cursor.get_x()/PANGO_SCALE, cursor.get_y()/PANGO_SCALE, + 10, cursor.get_height()/PANGO_SCALE); + cairo_fill (cr); + } } void @@ -371,7 +384,6 @@ AudioClock::start_edit () input_string.clear (); editing = true; - show_edit_status (1); queue_draw (); Keyboard::magic_widget_grab_focus (); |