mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-11 03:10:09 +00:00
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.
This commit is contained in:
parent
23a4affb6f
commit
2b6a4ba890
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user