bad first pass at a cursor for clock editing. lots to do here. cursor is not in the...
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 18 Nov 2011 05:25:22 +0000 (05:25 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 18 Nov 2011 05:25:22 +0000 (05:25 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@10671 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/audio_clock.cc

index e1e468e54426a7c3923dd5492a0262d3b579c3d6..6b2f621ab040c198b839ad3a70f798bd1b122ff3 100644 (file)
@@ -280,6 +280,19 @@ AudioClock::render (cairo_t* cr)
                        Gtkmm2ext::rounded_rectangle (cr, 0, upper_height + separator_height, _width, h, 9);
                }
        }
                        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
 }
 
 void
@@ -371,7 +384,6 @@ AudioClock::start_edit ()
        input_string.clear ();
        editing = true;
 
        input_string.clear ();
        editing = true;
 
-       show_edit_status (1);
        queue_draw ();
 
        Keyboard::magic_widget_grab_focus ();
        queue_draw ();
 
        Keyboard::magic_widget_grab_focus ();