mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
libsysprof-ui: try to keep text aligned on 5/8's split
This commit is contained in:
@ -152,10 +152,22 @@ sysprof_cell_renderer_duration_render (GtkCellRenderer *renderer,
|
|||||||
pango_layout_set_text (layout, str->str, str->len);
|
pango_layout_set_text (layout, str->str, str->len);
|
||||||
pango_layout_get_pixel_size (layout, &w, &h);
|
pango_layout_get_pixel_size (layout, &w, &h);
|
||||||
|
|
||||||
if ((r.x + r.width + w) < (cell_area->x + cell_area->width))
|
if (r.x < (cell_area->x + (cell_area->width / 8 * 5)))
|
||||||
cairo_move_to (cr, r.x + r.width, r.y + ((r.height - h) / 2));
|
{
|
||||||
|
/* This is if we're in the first half of screen */
|
||||||
|
if ((r.x + r.width + w) < (cell_area->x + cell_area->width))
|
||||||
|
cairo_move_to (cr, r.x + r.width, r.y + ((r.height - h) / 2));
|
||||||
|
else
|
||||||
|
cairo_move_to (cr, r.x - w, r.y + ((r.height - h) / 2));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
cairo_move_to (cr, r.x - w, r.y + ((r.height - h) / 2));
|
{
|
||||||
|
/* This is if we're in the second half of screen, do opposite */
|
||||||
|
if ((r.x - r.width) >= cell_area->x)
|
||||||
|
cairo_move_to (cr, r.x - w, r.y + ((r.height - h) / 2));
|
||||||
|
else
|
||||||
|
cairo_move_to (cr, r.x + r.width, r.y + ((r.height - h) / 2));
|
||||||
|
}
|
||||||
|
|
||||||
if (off > -1)
|
if (off > -1)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user