+ if (corner_radius) {
+ Gtkmm2ext::rounded_bottom_half_rectangle (cr, 0, upper_height + separator_height, get_width(), h, corner_radius);
+ } else {
+ cairo_rectangle (cr, 0, upper_height + separator_height, get_width(), h);
+ }
+ cairo_fill (cr);
+ }
+ }
+ }
+
+ if (editing) {
+ if (!insert_map.empty()) {
+
+ int xcenter = layout_x_offset > corner_radius/4.0 ? 0 : (get_width() - _mode_width[_mode]) /2;
+
+ if (input_string.length() < insert_map.size()) {
+ Pango::Rectangle cursor;
+
+ if (input_string.empty()) {
+ /* nothing entered yet, put cursor at the end
+ of string
+ */
+ cursor = _layout->get_cursor_strong_pos (edit_string.length() - 1);
+ } else {
+ cursor = _layout->get_cursor_strong_pos (insert_map[input_string.length()]);
+ }
+
+ cairo_set_source_rgba (cr, cursor_r, cursor_g, cursor_b, cursor_a);
+ if (!_fixed_width) {
+ cairo_rectangle (cr,
+ min (get_width() - 2.0,
+ (double) cursor.get_x()/PANGO_SCALE + layout_x_offset + xcenter + em_width), 0,
+ 2.0, cursor.get_height()/PANGO_SCALE);
+ } else {
+ cairo_rectangle (cr,
+ min (get_width() - 2.0,
+ (double) layout_x_offset + xcenter + cursor.get_x()/PANGO_SCALE + em_width),
+ (upper_height - layout_height)/2.0,
+ 2.0, cursor.get_height()/PANGO_SCALE);
+ }
+ cairo_fill (cr);
+ } else {
+ /* we've entered all possible digits, no cursor */
+ }
+
+ } else {
+ if (input_string.empty()) {
+ cairo_set_source_rgba (cr, cursor_r, cursor_g, cursor_b, cursor_a);
+ if (!_fixed_width) {
+ cairo_rectangle (cr,
+ (get_width()/2.0),
+ 0,
+ 2.0, upper_height);
+ } else {
+ cairo_rectangle (cr,
+ (get_width()/2.0),
+ (upper_height - layout_height)/2.0,
+ 2.0, upper_height);
+ }