- if (_need_bg) {
- if (corner_radius) {
- Gtkmm2ext::rounded_bottom_half_rectangle (cr, left_rect_width + separator_height,
- upper_height + separator_height,
- get_width() - separator_height - left_rect_width,
- h, corner_radius);
- } else {
- cairo_rectangle (cr, left_rect_width + separator_height, upper_height + separator_height,
- get_width() - separator_height - left_rect_width, h);
- }
- cairo_fill (cr);
- }
-
-
- if (_right_layout->get_alignment() == Pango::ALIGN_RIGHT) {
- /* right-align does not work per se beacuse layout width is unset.
- * Using _right_layout->set_width([value >=0]) would also enable
- * word-wrapping which is not wanted here.
- * The solution is to custom align the layout depending on its size.
- * if it is larger than the available space it will be cropped on the
- * right edge rather than override text on the left side.
- */
- int x, rw, rh;
- _right_layout->get_pixel_size(rw, rh);
- x = get_width() - rw - separator_height - x_leading_padding;
- if (x < x_leading_padding + left_rect_width + separator_height) {
- /* rather cut off the right end than overlap with the text on the left */
- x = x_leading_padding + left_rect_width + separator_height;
- }
- cairo_move_to (cr, x, upper_height + separator_height + ((h - info_height)/2.0));
- } else {
- cairo_move_to (cr, x_leading_padding + left_rect_width + separator_height, upper_height + separator_height + ((h - info_height)/2.0));
- }
- pango_cairo_show_layout (cr, _right_layout->gobj());