diff options
author | Nick Østergaard <oe.nick@gmail.com> | 2021-01-02 19:35:28 +0100 |
---|---|---|
committer | Nick Østergaard <oe.nick@gmail.com> | 2021-01-03 17:01:39 +0100 |
commit | 4ebe14f323d1752e8fc74465ffbb22d7c2868d81 (patch) | |
tree | 632d6c2b77707762608d6ce8543a8107b38024ad | |
parent | 10206a0082be18322beb94b1abf91d87415a901e (diff) | |
download | distcc-git-4ebe14f323d1752e8fc74465ffbb22d7c2868d81.tar.gz |
Reomve color initialization
As it seems that this is not needed for gtk3 with the cairo stuff.
-rw-r--r-- | src/mon-gnome.c | 33 | ||||
-rw-r--r-- | src/renderer.c | 18 | ||||
-rw-r--r-- | src/renderer.h | 2 |
3 files changed, 5 insertions, 48 deletions
diff --git a/src/mon-gnome.c b/src/mon-gnome.c index c09140c..0882b59 100644 --- a/src/mon-gnome.c +++ b/src/mon-gnome.c @@ -448,35 +448,6 @@ static gint dcc_gnome_load_update_cb (gpointer data) /** - * Initialize graphics context for drawing into a widget in the right - * color for each state. - **/ -static void -dcc_create_state_gcs (GtkWidget *widget) -{ - enum dcc_phase i_state; -#if 0 - for (i_state = 0; i_state < DCC_PHASE_DONE; i_state++) - { - dcc_phase_gc[i_state] = gdk_gc_new (widget->window); - gdk_gc_set_rgb_fg_color (dcc_phase_gc[i_state], - (GdkColor *) &task_color[i_state]); - - } -#else - for (i_state = 0; i_state < DCC_PHASE_DONE; i_state++) - { - GdkWindow * gdk_window = gtk_widget_get_window (widget); - dcc_phase_gc[i_state] = gdk_cairo_create(gdk_window); - gdk_cairo_set_source_color (dcc_phase_gc[i_state], - (GdkColor *) &task_color[i_state]); - - } -#endif -} - - -/** * Configure GtkTreeView with the right columns bound to * renderers, and a data model. **/ @@ -497,10 +468,6 @@ static void dcc_gnome_make_proc_view (GtkTreeModel *proc_model, gtk_tree_selection_set_mode (selection, GTK_SELECTION_NONE); - /* we can't create the gcs until the widget is first realized */ - g_signal_connect_after (chart_treeview, "realize", - G_CALLBACK (dcc_create_state_gcs), NULL); - text_renderer = gtk_cell_renderer_text_new (); chart_renderer = dcc_cell_renderer_chart_new (); diff --git a/src/renderer.c b/src/renderer.c index a73c8de..8f12d9b 100644 --- a/src/renderer.c +++ b/src/renderer.c @@ -183,17 +183,6 @@ dcc_cell_renderer_chart_render (GtkCellRenderer *cell, y1 = cell_area->y + ypad; bar_height = cell_area->height - (2 * ypad); - const GdkColor task_color[] = { - { 0, 0x9999, 0, 0 }, /* DCC_PHASE_STARTUP, accent red dark */ - { 0, 0x9999, 0, 0 }, /* DCC_PHASE_BLOCKED, accent red dark */ - { 0, 0xc1c1, 0x6666, 0x5a5a }, /* DCC_PHASE_CONNECT, red medium */ - { 0, 0x8888, 0x7f7f, 0xa3a3 }, /* DCC_PHASE_CPP, purple medium*/ - { 0, 0xe0e0, 0xc3c3, 0x9e9e }, /* DCC_PHASE_SEND, face skin medium*/ - { 0, 0x8383, 0xa6a6, 0x7f7f }, /* DCC_PHASE_COMPILE, green medium */ - { 0, 0x7575, 0x9090, 0xaeae }, /* DCC_PHASE_RECEIVE, blue medium*/ - { 0, 0, 0, 0 }, /* DCC_PHASE_DONE */ -}; - /* bar width is chosen such that the history roughly fills the cell @@ -218,10 +207,9 @@ dcc_cell_renderer_chart_render (GtkCellRenderer *cell, TRUE, /* fill */ x1, y1, bar_width, bar_height); #else -gdk_cairo_set_source_color (cr, (GdkColor *) &task_color[state]); -cairo_rectangle (cr, x1, y1, bar_width, bar_height); -cairo_fill (cr); -//cairo_destroy (cr); + gdk_cairo_set_source_color (cr, (GdkColor *) &task_color[state]); + cairo_rectangle (cr, x1, y1, bar_width, bar_height); + cairo_fill (cr); #endif } diff --git a/src/renderer.h b/src/renderer.h index 4f46eef..010b730 100644 --- a/src/renderer.h +++ b/src/renderer.h @@ -47,3 +47,5 @@ GtkCellRenderer *dcc_cell_renderer_chart_new (void); extern cairo_t *dcc_phase_gc[DCC_PHASE_DONE]; extern const guint dcc_max_history_queue; + +extern const GdkColor task_color[]; |