Commit 4a5da8d0 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Use a bit of the GtkLabel structure to remember that a pattern has been

2007-07-09  Matthias Clasen  <mclasen@redhat.com>

        * gtklabel.[ch]: Use a bit of the GtkLabel structure to
        remember that a pattern has been set.
        (gtk_label_set_pattern_internal): Don't do anything if
        a specific pattern has been set.
        (gtk_label_set_pattern): set the new bit to TRUE when
        setting a pattern, and recalculate everything if the
        pattern is unset. Fix gtk_label_set_pattern() not working
        anymore.  (#452861, Vincent Untz)



svn path=/trunk/; revision=18426
parent 50499f03
2007-07-09 Matthias Clasen <mclasen@redhat.com>
* gtklabel.[ch]: Use a bit of the GtkLabel structure to
remember that a pattern has been set.
(gtk_label_set_pattern_internal): Don't do anything if
a specific pattern has been set.
(gtk_label_set_pattern): set the new bit to TRUE when
setting a pattern, and recalculate everything if the
pattern is unset. Fix gtk_label_set_pattern() not working
anymore. (#452861, Vincent Untz)
2007-07-09 Claude Paroz <claude@2xlibre.net>
* configure.in: Changed uz to uz@cyrillic and uz@Latn to uz.
......
......@@ -798,6 +798,7 @@ gtk_label_init (GtkLabel *label)
label->use_underline = FALSE;
label->use_markup = FALSE;
label->pattern_set = FALSE;
label->mnemonic_keyval = GDK_VoidSymbol;
label->layout = NULL;
......@@ -1537,6 +1538,9 @@ gtk_label_set_pattern_internal (GtkLabel *label,
g_return_if_fail (GTK_IS_LABEL (label));
if (label->pattern_set)
return;
g_object_get (gtk_widget_get_settings (GTK_WIDGET (label)),
"gtk-enable-mnemonics", &enable_mnemonics,
NULL);
......@@ -1557,7 +1561,15 @@ gtk_label_set_pattern (GtkLabel *label,
{
g_return_if_fail (GTK_IS_LABEL (label));
gtk_label_set_pattern_internal (label, pattern);
label->pattern_set = FALSE;
if (pattern)
{
gtk_label_set_pattern_internal (label, pattern);
label->pattern_set = TRUE;
}
else
gtk_label_recalculate (label);
gtk_label_clear_layout (label);
gtk_widget_queue_resize (GTK_WIDGET (label));
......
......@@ -62,6 +62,7 @@ struct _GtkLabel
guint have_transform : 1;
guint in_click : 1;
guint wrap_mode : 3;
guint pattern_set : 1;
guint mnemonic_keyval;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment