[gtk+] GtkColorChooserWidget: Redraw swatches when selection changes

commit 19510cdec7c0c51aaba2cf7a38d555cd5bbf22ae
Author: Marcus Karlsson <mk acc umu se>
Date:   Sat Apr 12 10:09:46 2014 +0200

    GtkColorChooserWidget: Redraw swatches when selection changes
    When selecting a swatch in a GtkColorChooserWidget the previously
    selected swatch and the currently selected swatch are not redrawn. This
    can leave the old swatch still marked with a checkbox even though a new
    swatch has been selected.
    Redraw the swatches after changing the selection.

 gtk/gtkcolorchooserwidget.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/gtk/gtkcolorchooserwidget.c b/gtk/gtkcolorchooserwidget.c
index e31c620..a8fb9cf 100644
--- a/gtk/gtkcolorchooserwidget.c
+++ b/gtk/gtkcolorchooserwidget.c
@@ -101,9 +101,14 @@ select_swatch (GtkColorChooserWidget *cc,
   if (cc->priv->current != NULL)
-    gtk_widget_unset_state_flags (GTK_WIDGET (cc->priv->current), GTK_STATE_FLAG_SELECTED);
+    {
+      gtk_widget_unset_state_flags (GTK_WIDGET (cc->priv->current), GTK_STATE_FLAG_SELECTED);
+      gtk_widget_queue_draw (GTK_WIDGET (cc->priv->current));
+    }
   gtk_widget_set_state_flags (GTK_WIDGET (swatch), GTK_STATE_FLAG_SELECTED, FALSE);
   cc->priv->current = swatch;
+  gtk_widget_queue_draw (GTK_WIDGET (cc->priv->current));
   gtk_color_swatch_get_rgba (swatch, &color);
   g_settings_set (cc->priv->settings, "selected-color", "(bdddd)",

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]