From ded7626eeb5c985c2a767ff15e81044142939ce6 Mon Sep 17 00:00:00 2001 From: Ian Peters Date: Sun, 11 Feb 2001 03:58:55 +0000 Subject: use the font->ascent and ->descent to calculate the requisition height, * gtk/gtkprogressbar.c (gtk_progress_bar_size_request): use the font->ascent and ->descent to calculate the requisition height, rather than the gdk_text_height (gtk_progress_bar_paint): use the font->ascent instead of the gdk_text_height when calculating the vertical offset of the text label on the progress bar. This fixes the baseline of the font on the widget. --- ChangeLog | 10 ++++++++++ ChangeLog.pre-2-0 | 10 ++++++++++ ChangeLog.pre-2-10 | 10 ++++++++++ ChangeLog.pre-2-2 | 10 ++++++++++ ChangeLog.pre-2-4 | 10 ++++++++++ ChangeLog.pre-2-6 | 10 ++++++++++ ChangeLog.pre-2-8 | 10 ++++++++++ gtk/gtkprogressbar.c | 11 +++++------ 8 files changed, 75 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0288aba4e..89069b448 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2001-02-10 Ian Peters + + * gtk/gtkprogressbar.c (gtk_progress_bar_size_request): use the + font->ascent and ->descent to calculate the requisition height, + rather than the gdk_text_height + (gtk_progress_bar_paint): use the font->ascent instead of the + gdk_text_height when calculating the vertical offset of the text + label on the progress bar. This fixes the baseline of the font on + the widget. + Fri Feb 2 19:21:23 2001 Owen Taylor * gdk/gdkwindow.c (gdk_propagate_shapes): Surround additional diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 0288aba4e..89069b448 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,13 @@ +2001-02-10 Ian Peters + + * gtk/gtkprogressbar.c (gtk_progress_bar_size_request): use the + font->ascent and ->descent to calculate the requisition height, + rather than the gdk_text_height + (gtk_progress_bar_paint): use the font->ascent instead of the + gdk_text_height when calculating the vertical offset of the text + label on the progress bar. This fixes the baseline of the font on + the widget. + Fri Feb 2 19:21:23 2001 Owen Taylor * gdk/gdkwindow.c (gdk_propagate_shapes): Surround additional diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0288aba4e..89069b448 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +2001-02-10 Ian Peters + + * gtk/gtkprogressbar.c (gtk_progress_bar_size_request): use the + font->ascent and ->descent to calculate the requisition height, + rather than the gdk_text_height + (gtk_progress_bar_paint): use the font->ascent instead of the + gdk_text_height when calculating the vertical offset of the text + label on the progress bar. This fixes the baseline of the font on + the widget. + Fri Feb 2 19:21:23 2001 Owen Taylor * gdk/gdkwindow.c (gdk_propagate_shapes): Surround additional diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 0288aba4e..89069b448 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,13 @@ +2001-02-10 Ian Peters + + * gtk/gtkprogressbar.c (gtk_progress_bar_size_request): use the + font->ascent and ->descent to calculate the requisition height, + rather than the gdk_text_height + (gtk_progress_bar_paint): use the font->ascent instead of the + gdk_text_height when calculating the vertical offset of the text + label on the progress bar. This fixes the baseline of the font on + the widget. + Fri Feb 2 19:21:23 2001 Owen Taylor * gdk/gdkwindow.c (gdk_propagate_shapes): Surround additional diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 0288aba4e..89069b448 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,13 @@ +2001-02-10 Ian Peters + + * gtk/gtkprogressbar.c (gtk_progress_bar_size_request): use the + font->ascent and ->descent to calculate the requisition height, + rather than the gdk_text_height + (gtk_progress_bar_paint): use the font->ascent instead of the + gdk_text_height when calculating the vertical offset of the text + label on the progress bar. This fixes the baseline of the font on + the widget. + Fri Feb 2 19:21:23 2001 Owen Taylor * gdk/gdkwindow.c (gdk_propagate_shapes): Surround additional diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 0288aba4e..89069b448 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,13 @@ +2001-02-10 Ian Peters + + * gtk/gtkprogressbar.c (gtk_progress_bar_size_request): use the + font->ascent and ->descent to calculate the requisition height, + rather than the gdk_text_height + (gtk_progress_bar_paint): use the font->ascent instead of the + gdk_text_height when calculating the vertical offset of the text + label on the progress bar. This fixes the baseline of the font on + the widget. + Fri Feb 2 19:21:23 2001 Owen Taylor * gdk/gdkwindow.c (gdk_propagate_shapes): Surround additional diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 0288aba4e..89069b448 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,13 @@ +2001-02-10 Ian Peters + + * gtk/gtkprogressbar.c (gtk_progress_bar_size_request): use the + font->ascent and ->descent to calculate the requisition height, + rather than the gdk_text_height + (gtk_progress_bar_paint): use the font->ascent instead of the + gdk_text_height when calculating the vertical offset of the text + label on the progress bar. This fixes the baseline of the font on + the widget. + Fri Feb 2 19:21:23 2001 Owen Taylor * gdk/gdkwindow.c (gdk_propagate_shapes): Surround additional diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c index 1905f31a8..cee29a1f9 100644 --- a/gtk/gtkprogressbar.c +++ b/gtk/gtkprogressbar.c @@ -373,8 +373,8 @@ gtk_progress_bar_size_request (GtkWidget *widget, requisition->height = MAX (MIN_HORIZONTAL_BAR_HEIGHT, 2 * widget->style->klass->ythickness + 3 + - gdk_text_height (widget->style->font, - buf, strlen (buf)) + + widget->style->font->ascent + + widget->style->font->descent + 2 * TEXT_SPACING); g_free (buf); } @@ -399,8 +399,8 @@ gtk_progress_bar_size_request (GtkWidget *widget, requisition->height = MAX (MIN_VERTICAL_BAR_HEIGHT, 2 * widget->style->klass->ythickness + 3 + - gdk_text_height (widget->style->font, - buf, strlen (buf)) + + widget->style->font->ascent + + widget->style->font->descent + 2 * TEXT_SPACING); g_free (buf); } @@ -717,8 +717,7 @@ gtk_progress_bar_paint (GtkProgress *progress) y = widget->style->font->ascent + 1 + (widget->allocation.height - 2 * widget->style->klass->ythickness - - 3 - gdk_text_height (widget->style->font, buf, strlen (buf))) - * progress->y_align; + 3 - widget->style->font->ascent) * progress->y_align; rect.x = widget->style->klass->xthickness + 1; rect.y = widget->style->klass->ythickness + 1; -- cgit v1.2.1