[gtk+] gtk-demo: Remove useless code in colorsel example
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtk-demo: Remove useless code in colorsel example
- Date: Fri, 3 Oct 2014 04:49:22 +0000 (UTC)
commit 2b6a4ba8907c82ba1844711606a3cf6292fe25e2
Author: Benjamin Otte <otte redhat com>
Date: Fri Oct 3 06:48:18 2014 +0200
gtk-demo: Remove useless code in colorsel example
We have the color stored in a global variable already. There is
absolutely no need to also force it into the CSS machinery.
demos/gtk-demo/colorsel.c | 10 +---------
1 files changed, 1 insertions(+), 9 deletions(-)
---
diff --git a/demos/gtk-demo/colorsel.c b/demos/gtk-demo/colorsel.c
index 73a9505..8f0cc18 100644
--- a/demos/gtk-demo/colorsel.c
+++ b/demos/gtk-demo/colorsel.c
@@ -20,12 +20,7 @@ draw_callback (GtkWidget *widget,
cairo_t *cr,
gpointer data)
{
- GtkStyleContext *context;
- GdkRGBA rgba;
-
- context = gtk_widget_get_style_context (widget);
- gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &rgba);
- gdk_cairo_set_source_rgba (cr, &rgba);
+ gdk_cairo_set_source_rgba (cr, &color);
cairo_paint (cr);
return TRUE;
@@ -39,7 +34,6 @@ response_cb (GtkDialog *dialog,
if (response_id == GTK_RESPONSE_OK)
{
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (dialog), &color);
- gtk_widget_override_background_color (da, 0, &color);
}
gtk_widget_destroy (GTK_WIDGET (dialog));
@@ -105,8 +99,6 @@ do_colorsel (GtkWidget *do_widget)
/* set a minimum size */
gtk_widget_set_size_request (da, 200, 200);
- /* set the color */
- gtk_widget_override_background_color (da, 0, &color);
gtk_container_add (GTK_CONTAINER (frame), da);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]