mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
libsysprof-gtk: soften line marks
This commit is contained in:
@ -58,6 +58,7 @@ sysprof_time_ruler_snapshot (GtkWidget *widget,
|
|||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
GdkRGBA color;
|
GdkRGBA color;
|
||||||
|
GdkRGBA line_color;
|
||||||
|
|
||||||
g_assert (SYSPROF_IS_TIME_RULER (self));
|
g_assert (SYSPROF_IS_TIME_RULER (self));
|
||||||
g_assert (GTK_IS_SNAPSHOT (snapshot));
|
g_assert (GTK_IS_SNAPSHOT (snapshot));
|
||||||
@ -73,6 +74,8 @@ sysprof_time_ruler_snapshot (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
GtkStyleContext *style_context = gtk_widget_get_style_context (widget);
|
GtkStyleContext *style_context = gtk_widget_get_style_context (widget);
|
||||||
gtk_style_context_get_color (style_context, &color);
|
gtk_style_context_get_color (style_context, &color);
|
||||||
|
line_color = color;
|
||||||
|
line_color.alpha *= .3;
|
||||||
}
|
}
|
||||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
@ -113,16 +116,14 @@ sysprof_time_ruler_snapshot (GtkWidget *widget,
|
|||||||
gtk_snapshot_restore (snapshot);
|
gtk_snapshot_restore (snapshot);
|
||||||
|
|
||||||
gtk_snapshot_append_color (snapshot,
|
gtk_snapshot_append_color (snapshot,
|
||||||
&color,
|
&line_color,
|
||||||
&GRAPHENE_RECT_INIT (x, 0, 1, height));
|
&GRAPHENE_RECT_INIT (x, 0, 1, height));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self->motion_x >= 0 && self->motion_y >= 0)
|
if (self->motion_x >= 0 && self->motion_y >= 0)
|
||||||
{
|
gtk_snapshot_append_color (snapshot,
|
||||||
gtk_snapshot_append_color (snapshot,
|
&color,
|
||||||
&color,
|
&GRAPHENE_RECT_INIT (self->motion_x, 0, 1, height));
|
||||||
&GRAPHENE_RECT_INIT (self->motion_x, 0, 1, height));
|
|
||||||
}
|
|
||||||
|
|
||||||
g_object_unref (layout);
|
g_object_unref (layout);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user