summaryrefslogtreecommitdiff
path: root/src/gtkext/gtkbufferview.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-06-04 18:19:30 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-06-04 18:19:30 (GMT)
commit83ba2204e700501023cb78dfd84978c611fe61b0 (patch)
tree6fecf15dda7b1d115d1fe1c0c6b4d262ac30d332 /src/gtkext/gtkbufferview.c
parent1b66b99cbb621bd97d917ef7830697b93fa36ae5 (diff)
Restored nice colors for buffer views.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@377 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gtkext/gtkbufferview.c')
-rw-r--r--src/gtkext/gtkbufferview.c40
1 files changed, 9 insertions, 31 deletions
diff --git a/src/gtkext/gtkbufferview.c b/src/gtkext/gtkbufferview.c
index bcf7ba0..38fff5a 100644
--- a/src/gtkext/gtkbufferview.c
+++ b/src/gtkext/gtkbufferview.c
@@ -483,8 +483,8 @@ static gboolean gtk_buffer_view_draw(GtkWidget *widget, cairo_t *cr)
cairo_rectangle_int_t area; /* Surface correspondante */
gint fake_x; /* Abscisse virtuelle */
gint fake_y; /* Ordonnée virtuelle */
- GtkStateFlags state; /* Etat du composant */
- GdkRGBA *color; /* Couleur du curseur */
+ GtkStyleContext *context; /* Contexte du thème actuel */
+ GdkRGBA color; /* Couleur du curseur */
view = GTK_BUFFER_VIEW(widget);
widget = GTK_WIDGET(view);
@@ -498,40 +498,18 @@ static gboolean gtk_buffer_view_draw(GtkWidget *widget, cairo_t *cr)
fake_y = 0;
gtk_buffer_view_compute_fake_coord(view, &fake_x, &fake_y);
-
- do
- {
-
-
- GtkStyleContext *context;
-
-
- context = gtk_widget_get_style_context(widget);
-
- gtk_render_background(context, cr, 0, 0, 250, 250);
-
- printf("Passage!\n");
-
-
- } while (0);
-
-
-
/* Dessin de la marge gauche */
- state = gtk_widget_get_state_flags(widget);
+ context = gtk_widget_get_style_context(widget);
- gtk_style_context_get(gtk_widget_get_style_context(widget), state,
- GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &color, NULL);
+ gtk_style_context_save(context);
+ gtk_style_context_add_class(context, GTK_STYLE_CLASS_TROUGH);
+ gtk_style_context_get_color(context, GTK_STATE_FLAG_BACKDROP | GTK_STATE_FLAG_DIR_LTR, &color);
+ gtk_style_context_restore(context);
- cairo_rectangle(cr, fake_x, area.y, view->left_margin, area.y + area.height);
- cairo_fill(cr);
+ cairo_set_source_rgb(cr, color.red, color.green, color.blue);
- gtk_style_context_get(gtk_widget_get_style_context(widget), state,
- GTK_STYLE_PROPERTY_BORDER_COLOR, &color, NULL);
-
- cairo_move_to(cr, fake_x + view->left_margin, area.y);
- cairo_line_to(cr, fake_x + view->left_margin, area.y + area.height);
+ cairo_rectangle(cr, fake_x, area.y, view->left_margin, area.y + area.height);
cairo_fill(cr);
/* Eventuelle bordure globale */