mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
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
This commit is contained in:
parent
329a54d129
commit
3aa7dacfdf
1 changed files with 13 additions and 1 deletions
|
|
@ -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 ();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue