Mon Dec 16 17:20:02 2002 Soeren Sandmann <sandmann@daimi.au.dk> * gtk/gtkaccellabel.c: Implement Owen's susggestion from #80764. Fixes #101314.
This commit is contained in:

committed by
Søren Sandmann Pedersen

parent
6669d0c581
commit
a04d59791a
@ -1,3 +1,8 @@
|
|||||||
|
Mon Dec 16 17:20:02 2002 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||||
|
|
||||||
|
* gtk/gtkaccellabel.c: Implement Owen's susggestion from
|
||||||
|
#80764. Fixes #101314.
|
||||||
|
|
||||||
Sun Dec 15 18:47:30 2002 Owen Taylor <otaylor@redhat.com>
|
Sun Dec 15 18:47:30 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
Some fixes for modal hint setting based on a patch
|
Some fixes for modal hint setting based on a patch
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
Mon Dec 16 17:20:02 2002 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||||
|
|
||||||
|
* gtk/gtkaccellabel.c: Implement Owen's susggestion from
|
||||||
|
#80764. Fixes #101314.
|
||||||
|
|
||||||
Sun Dec 15 18:47:30 2002 Owen Taylor <otaylor@redhat.com>
|
Sun Dec 15 18:47:30 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
Some fixes for modal hint setting based on a patch
|
Some fixes for modal hint setting based on a patch
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
Mon Dec 16 17:20:02 2002 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||||
|
|
||||||
|
* gtk/gtkaccellabel.c: Implement Owen's susggestion from
|
||||||
|
#80764. Fixes #101314.
|
||||||
|
|
||||||
Sun Dec 15 18:47:30 2002 Owen Taylor <otaylor@redhat.com>
|
Sun Dec 15 18:47:30 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
Some fixes for modal hint setting based on a patch
|
Some fixes for modal hint setting based on a patch
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
Mon Dec 16 17:20:02 2002 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||||
|
|
||||||
|
* gtk/gtkaccellabel.c: Implement Owen's susggestion from
|
||||||
|
#80764. Fixes #101314.
|
||||||
|
|
||||||
Sun Dec 15 18:47:30 2002 Owen Taylor <otaylor@redhat.com>
|
Sun Dec 15 18:47:30 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
Some fixes for modal hint setting based on a patch
|
Some fixes for modal hint setting based on a patch
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
Mon Dec 16 17:20:02 2002 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||||
|
|
||||||
|
* gtk/gtkaccellabel.c: Implement Owen's susggestion from
|
||||||
|
#80764. Fixes #101314.
|
||||||
|
|
||||||
Sun Dec 15 18:47:30 2002 Owen Taylor <otaylor@redhat.com>
|
Sun Dec 15 18:47:30 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
Some fixes for modal hint setting based on a patch
|
Some fixes for modal hint setting based on a patch
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
Mon Dec 16 17:20:02 2002 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||||
|
|
||||||
|
* gtk/gtkaccellabel.c: Implement Owen's susggestion from
|
||||||
|
#80764. Fixes #101314.
|
||||||
|
|
||||||
Sun Dec 15 18:47:30 2002 Owen Taylor <otaylor@redhat.com>
|
Sun Dec 15 18:47:30 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
Some fixes for modal hint setting based on a patch
|
Some fixes for modal hint setting based on a patch
|
||||||
|
@ -56,11 +56,11 @@ static void gtk_accel_label_size_request (GtkWidget *widget,
|
|||||||
GtkRequisition *requisition);
|
GtkRequisition *requisition);
|
||||||
static gboolean gtk_accel_label_expose_event (GtkWidget *widget,
|
static gboolean gtk_accel_label_expose_event (GtkWidget *widget,
|
||||||
GdkEventExpose *event);
|
GdkEventExpose *event);
|
||||||
static gboolean gtk_accel_label_refetch_idle (GtkAccelLabel *accel_label);
|
static const gchar *gtk_accel_label_get_string (GtkAccelLabel *accel_label);
|
||||||
|
|
||||||
|
|
||||||
static GtkLabelClass *parent_class = NULL;
|
static GtkLabelClass *parent_class = NULL;
|
||||||
|
|
||||||
|
|
||||||
GType
|
GType
|
||||||
gtk_accel_label_get_type (void)
|
gtk_accel_label_get_type (void)
|
||||||
{
|
{
|
||||||
@ -278,7 +278,7 @@ gtk_accel_label_size_request (GtkWidget *widget,
|
|||||||
if (GTK_WIDGET_CLASS (parent_class)->size_request)
|
if (GTK_WIDGET_CLASS (parent_class)->size_request)
|
||||||
GTK_WIDGET_CLASS (parent_class)->size_request (widget, requisition);
|
GTK_WIDGET_CLASS (parent_class)->size_request (widget, requisition);
|
||||||
|
|
||||||
layout = gtk_widget_create_pango_layout (widget, accel_label->accel_string);
|
layout = gtk_widget_create_pango_layout (widget, gtk_accel_label_get_string (accel_label));
|
||||||
pango_layout_get_pixel_size (layout, &width, NULL);
|
pango_layout_get_pixel_size (layout, &width, NULL);
|
||||||
accel_label->accel_string_width = width;
|
accel_label->accel_string_width = width;
|
||||||
|
|
||||||
@ -339,7 +339,7 @@ gtk_accel_label_expose_event (GtkWidget *widget,
|
|||||||
label_layout = gtk_label_get_layout (GTK_LABEL (accel_label));
|
label_layout = gtk_label_get_layout (GTK_LABEL (accel_label));
|
||||||
gtk_label_get_layout_offsets (GTK_LABEL (accel_label), NULL, &y);
|
gtk_label_get_layout_offsets (GTK_LABEL (accel_label), NULL, &y);
|
||||||
|
|
||||||
accel_layout = gtk_widget_create_pango_layout (widget, accel_label->accel_string);
|
accel_layout = gtk_widget_create_pango_layout (widget, gtk_accel_label_get_string (accel_label));
|
||||||
|
|
||||||
y += get_first_baseline (label_layout) - get_first_baseline (accel_layout);
|
y += get_first_baseline (label_layout) - get_first_baseline (accel_layout);
|
||||||
|
|
||||||
@ -423,6 +423,18 @@ gtk_accel_label_set_accel_widget (GtkAccelLabel *accel_label,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gtk_accel_label_reset (GtkAccelLabel *accel_label)
|
||||||
|
{
|
||||||
|
if (accel_label->accel_string)
|
||||||
|
{
|
||||||
|
g_free (accel_label->accel_string);
|
||||||
|
accel_label->accel_string = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
gtk_widget_queue_resize (GTK_WIDGET (accel_label));
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
check_accel_changed (GtkAccelGroup *accel_group,
|
check_accel_changed (GtkAccelGroup *accel_group,
|
||||||
guint keyval,
|
guint keyval,
|
||||||
@ -431,7 +443,7 @@ check_accel_changed (GtkAccelGroup *accel_group,
|
|||||||
GtkAccelLabel *accel_label)
|
GtkAccelLabel *accel_label)
|
||||||
{
|
{
|
||||||
if (accel_closure == accel_label->accel_closure)
|
if (accel_closure == accel_label->accel_closure)
|
||||||
gtk_accel_label_refetch (accel_label);
|
gtk_accel_label_reset (accel_label);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -469,7 +481,7 @@ gtk_accel_label_set_accel_closure (GtkAccelLabel *accel_label,
|
|||||||
G_CALLBACK (check_accel_changed),
|
G_CALLBACK (check_accel_changed),
|
||||||
accel_label, 0);
|
accel_label, 0);
|
||||||
}
|
}
|
||||||
gtk_accel_label_refetch (accel_label);
|
gtk_accel_label_reset (accel_label);
|
||||||
g_object_notify (G_OBJECT (accel_label), "accel_closure");
|
g_object_notify (G_OBJECT (accel_label), "accel_closure");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -482,6 +494,15 @@ find_accel (GtkAccelKey *key,
|
|||||||
return data == (gpointer) closure;
|
return data == (gpointer) closure;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const gchar *
|
||||||
|
gtk_accel_label_get_string (GtkAccelLabel *accel_label)
|
||||||
|
{
|
||||||
|
if (!accel_label->accel_string)
|
||||||
|
gtk_accel_label_refetch (accel_label);
|
||||||
|
|
||||||
|
return accel_label->accel_string;
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gtk_accel_label_refetch (GtkAccelLabel *accel_label)
|
gtk_accel_label_refetch (GtkAccelLabel *accel_label)
|
||||||
{
|
{
|
||||||
@ -491,8 +512,11 @@ gtk_accel_label_refetch (GtkAccelLabel *accel_label)
|
|||||||
|
|
||||||
class = GTK_ACCEL_LABEL_GET_CLASS (accel_label);
|
class = GTK_ACCEL_LABEL_GET_CLASS (accel_label);
|
||||||
|
|
||||||
|
if (accel_label->accel_string)
|
||||||
|
{
|
||||||
g_free (accel_label->accel_string);
|
g_free (accel_label->accel_string);
|
||||||
accel_label->accel_string = NULL;
|
accel_label->accel_string = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (accel_label->accel_closure)
|
if (accel_label->accel_closure)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user