summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2001-06-26 15:15:00 +0000
committerOwen Taylor <otaylor@src.gnome.org>2001-06-26 15:15:00 +0000
commit671b3b0eb06ede434e5e64ff77e7444634cb59a1 (patch)
treea599235c68a5ff79d620ff372517815c5e869ff8
parentbd2b9eebafdbec4f72fb6660b82acfef6ad4c190 (diff)
downloadgtk+-671b3b0eb06ede434e5e64ff77e7444634cb59a1.tar.gz
Use new pango_context_get_metrics() to fix problems with font lists in
Tue Jun 26 11:06:34 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkclist.c gtk/gtkentry.c gtk/gtkspinbutton.c: Use new pango_context_get_metrics() to fix problems with font lists in descriptions. (#56184, reported by Jonas Borgström)
-rw-r--r--ChangeLog7
-rw-r--r--ChangeLog.pre-2-07
-rw-r--r--ChangeLog.pre-2-107
-rw-r--r--ChangeLog.pre-2-27
-rw-r--r--ChangeLog.pre-2-47
-rw-r--r--ChangeLog.pre-2-67
-rw-r--r--ChangeLog.pre-2-87
-rw-r--r--gtk/gtkclist.c10
-rw-r--r--gtk/gtkentry.c13
-rw-r--r--gtk/gtkspinbutton.c11
10 files changed, 61 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 07d8094789..2c84366144 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Tue Jun 26 11:06:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkclist.c gtk/gtkentry.c gtk/gtkspinbutton.c:
+ Use new pango_context_get_metrics() to fix problems
+ with font lists in descriptions. (#56184, reported by
+ Jonas Borgström)
+
Tue Jun 26 10:04:30 2001 Tim Janik <timj@gtk.org>
* gtk/gtkiconfactory.c:
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index 07d8094789..2c84366144 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,10 @@
+Tue Jun 26 11:06:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkclist.c gtk/gtkentry.c gtk/gtkspinbutton.c:
+ Use new pango_context_get_metrics() to fix problems
+ with font lists in descriptions. (#56184, reported by
+ Jonas Borgström)
+
Tue Jun 26 10:04:30 2001 Tim Janik <timj@gtk.org>
* gtk/gtkiconfactory.c:
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 07d8094789..2c84366144 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,10 @@
+Tue Jun 26 11:06:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkclist.c gtk/gtkentry.c gtk/gtkspinbutton.c:
+ Use new pango_context_get_metrics() to fix problems
+ with font lists in descriptions. (#56184, reported by
+ Jonas Borgström)
+
Tue Jun 26 10:04:30 2001 Tim Janik <timj@gtk.org>
* gtk/gtkiconfactory.c:
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index 07d8094789..2c84366144 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,10 @@
+Tue Jun 26 11:06:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkclist.c gtk/gtkentry.c gtk/gtkspinbutton.c:
+ Use new pango_context_get_metrics() to fix problems
+ with font lists in descriptions. (#56184, reported by
+ Jonas Borgström)
+
Tue Jun 26 10:04:30 2001 Tim Janik <timj@gtk.org>
* gtk/gtkiconfactory.c:
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 07d8094789..2c84366144 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,10 @@
+Tue Jun 26 11:06:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkclist.c gtk/gtkentry.c gtk/gtkspinbutton.c:
+ Use new pango_context_get_metrics() to fix problems
+ with font lists in descriptions. (#56184, reported by
+ Jonas Borgström)
+
Tue Jun 26 10:04:30 2001 Tim Janik <timj@gtk.org>
* gtk/gtkiconfactory.c:
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 07d8094789..2c84366144 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,10 @@
+Tue Jun 26 11:06:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkclist.c gtk/gtkentry.c gtk/gtkspinbutton.c:
+ Use new pango_context_get_metrics() to fix problems
+ with font lists in descriptions. (#56184, reported by
+ Jonas Borgström)
+
Tue Jun 26 10:04:30 2001 Tim Janik <timj@gtk.org>
* gtk/gtkiconfactory.c:
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 07d8094789..2c84366144 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,10 @@
+Tue Jun 26 11:06:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkclist.c gtk/gtkentry.c gtk/gtkspinbutton.c:
+ Use new pango_context_get_metrics() to fix problems
+ with font lists in descriptions. (#56184, reported by
+ Jonas Borgström)
+
Tue Jun 26 10:04:30 2001 Tim Janik <timj@gtk.org>
* gtk/gtkiconfactory.c:
diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c
index 76581eb1a3..653783417e 100644
--- a/gtk/gtkclist.c
+++ b/gtk/gtkclist.c
@@ -3026,13 +3026,11 @@ gtk_clist_set_row_height (GtkCList *clist,
{
PangoContext *context = gtk_widget_get_pango_context (widget);
PangoFontMetrics metrics;
- PangoFont *font = pango_context_load_font (context, widget->style->font_desc);
- pango_font_get_metrics (font,
- pango_context_get_language (context),
- &metrics);
-
- g_object_unref (G_OBJECT (font));
+ pango_context_get_metrics (context,
+ widget->style->font_desc,
+ pango_context_get_language (context),
+ &metrics);
if (!GTK_CLIST_ROW_HEIGHT_SET(clist))
clist->row_height = PANGO_PIXELS (metrics.ascent + metrics.descent);
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 6cdaf71e29..7a0753acd3 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -1035,7 +1035,6 @@ gtk_entry_size_request (GtkWidget *widget,
{
GtkEntry *entry;
PangoFontMetrics metrics;
- PangoFont *font;
gint xborder, yborder;
PangoContext *context;
@@ -1045,15 +1044,11 @@ gtk_entry_size_request (GtkWidget *widget,
entry = GTK_ENTRY (widget);
- /* hackish for now, get metrics
- */
context = gtk_widget_get_pango_context (widget);
- font = pango_context_load_font (context, widget->style->font_desc);
- pango_font_get_metrics (font,
- pango_context_get_language (context),
- &metrics);
-
- g_object_unref (G_OBJECT (font));
+ pango_context_get_metrics (context,
+ widget->style->font_desc,
+ pango_context_get_language (context),
+ &metrics);
entry->ascent = metrics.ascent;
entry->descent = metrics.descent;
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index efbfdfc717..324aa87504 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -569,18 +569,15 @@ gtk_spin_button_size_request (GtkWidget *widget,
{
PangoContext *context;
PangoFontMetrics metrics;
- PangoFont *font;
gint width;
gint w;
int string_len;
context = gtk_widget_get_pango_context (widget);
- font = pango_context_load_font (context,
- widget->style->font_desc);
- pango_font_get_metrics (font,
- pango_context_get_language (context),
- &metrics);
- g_object_unref (G_OBJECT (font));
+ pango_context_get_metrics (context,
+ widget->style->font_desc,
+ pango_context_get_language (context),
+ &metrics);
/* Get max of MIN_SPIN_BUTTON_WIDTH, size of upper, size of lower */