[sysprof/wip/visualizers] line-visualizer-row: add color parameter for counter
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof/wip/visualizers] line-visualizer-row: add color parameter for counter
- Date: Wed, 28 Sep 2016 02:20:04 +0000 (UTC)
commit f3cec0f8c136733f1fb9c8c57897d79e93bd2b63
Author: Christian Hergert <chergert redhat com>
Date: Tue Sep 27 19:18:29 2016 -0700
line-visualizer-row: add color parameter for counter
Allow specifying a color for a counter that is added to the
visualizer.
lib/sp-line-visualizer-row.c | 14 ++++++++++++--
lib/sp-line-visualizer-row.h | 3 ++-
2 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/lib/sp-line-visualizer-row.c b/lib/sp-line-visualizer-row.c
index 4f3ff25..45471e9 100644
--- a/lib/sp-line-visualizer-row.c
+++ b/lib/sp-line-visualizer-row.c
@@ -584,7 +584,8 @@ sp_line_visualizer_row_init (SpLineVisualizerRow *self)
void
sp_line_visualizer_row_add_counter (SpLineVisualizerRow *self,
- guint counter_id)
+ guint counter_id,
+ const GdkRGBA *color)
{
SpLineVisualizerRowPrivate *priv = sp_line_visualizer_row_get_instance_private (self);
LineInfo line_info = { 0 };
@@ -593,9 +594,18 @@ sp_line_visualizer_row_add_counter (SpLineVisualizerRow *self,
g_assert (priv->lines != NULL);
line_info.id = counter_id;
- line_info.use_default_style = TRUE;
line_info.line_width = 1.0;
+ if (color != NULL)
+ {
+ line_info.foreground = *color;
+ line_info.use_default_style = FALSE;
+ }
+ else
+ {
+ line_info.use_default_style = TRUE;
+ }
+
g_array_append_val (priv->lines, line_info);
if (SP_LINE_VISUALIZER_ROW_GET_CLASS (self)->counter_added)
diff --git a/lib/sp-line-visualizer-row.h b/lib/sp-line-visualizer-row.h
index d992c5e..fee9348 100644
--- a/lib/sp-line-visualizer-row.h
+++ b/lib/sp-line-visualizer-row.h
@@ -55,7 +55,8 @@ struct _SpLineVisualizerRowClass
GtkWidget *sp_line_visualizer_row_new (void);
void sp_line_visualizer_row_clear (SpLineVisualizerRow *self);
void sp_line_visualizer_row_add_counter (SpLineVisualizerRow *self,
- guint counter_id);
+ guint counter_id,
+ const GdkRGBA *color);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]