[sysprof] libsysprof-ui: put wall time first
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] libsysprof-ui: put wall time first
- Date: Wed, 29 May 2019 22:43:43 +0000 (UTC)
commit a6848d1f4db2b269ebaf6cbb7967006deb8a6947
Author: Christian Hergert <chergert redhat com>
Date: Thu May 23 12:21:11 2019 -0700
libsysprof-ui: put wall time first
src/libsysprof-ui/sysprof-cell-renderer-duration.c | 23 +++++-----------------
1 file changed, 5 insertions(+), 18 deletions(-)
---
diff --git a/src/libsysprof-ui/sysprof-cell-renderer-duration.c
b/src/libsysprof-ui/sysprof-cell-renderer-duration.c
index cfe173b..49c4017 100644
--- a/src/libsysprof-ui/sysprof-cell-renderer-duration.c
+++ b/src/libsysprof-ui/sysprof-cell-renderer-duration.c
@@ -73,7 +73,6 @@ sysprof_cell_renderer_duration_render (GtkCellRenderer *renderer,
GdkRGBA rgba;
GdkRectangle r;
gint64 duration;
- gint off = -1;
g_assert (SYSPROF_IS_CELL_RENDERER_DURATION (self));
g_assert (cr != NULL);
@@ -127,18 +126,17 @@ sysprof_cell_renderer_duration_render (GtkCellRenderer *renderer,
cairo_stroke (cr);
}
- str = g_string_new (priv->text);
+ str = g_string_new (NULL);
if (priv->begin_time != priv->end_time)
{
g_autofree gchar *fmt = _sysprof_format_duration (priv->end_time - priv->begin_time);
-
- if (str->len)
- g_string_append (str, " — ");
- off = str->len;
- g_string_append (str, fmt);
+ g_string_append_printf (str, "%s — ", fmt);
}
+ if (priv->text != NULL)
+ g_string_append (str, priv->text);
+
if (str->len)
{
PangoLayout *layout;
@@ -158,17 +156,6 @@ sysprof_cell_renderer_duration_render (GtkCellRenderer *renderer,
else
cairo_move_to (cr, r.x - w, r.y + ((r.height - h) / 2));
- if (off > -1)
- {
- PangoAttrList *list = pango_attr_list_new ();
- PangoAttribute *attr = pango_attr_scale_new (0.8333);
- attr->start_index = off;
- attr->end_index = str->len;
- pango_attr_list_insert (list, g_steal_pointer (&attr));
- pango_layout_set_attributes (layout, list);
- pango_attr_list_unref (list);
- }
-
if (priv->end_time < priv->begin_time)
{
gdk_rgba_parse (&rgba, "#f00");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]