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.
This commit is contained in:
Ian Peters
2001-02-11 03:58:55 +00:00
parent 9f8ce57295
commit ded7626eeb
8 changed files with 75 additions and 6 deletions

View File

@@ -1,3 +1,13 @@
2001-02-10 Ian Peters <itp@ximian.com>
* 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 <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_propagate_shapes): Surround additional

View File

@@ -1,3 +1,13 @@
2001-02-10 Ian Peters <itp@ximian.com>
* 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 <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_propagate_shapes): Surround additional

View File

@@ -1,3 +1,13 @@
2001-02-10 Ian Peters <itp@ximian.com>
* 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 <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_propagate_shapes): Surround additional

View File

@@ -1,3 +1,13 @@
2001-02-10 Ian Peters <itp@ximian.com>
* 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 <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_propagate_shapes): Surround additional

View File

@@ -1,3 +1,13 @@
2001-02-10 Ian Peters <itp@ximian.com>
* 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 <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_propagate_shapes): Surround additional

View File

@@ -1,3 +1,13 @@
2001-02-10 Ian Peters <itp@ximian.com>
* 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 <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_propagate_shapes): Surround additional

View File

@@ -1,3 +1,13 @@
2001-02-10 Ian Peters <itp@ximian.com>
* 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 <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_propagate_shapes): Surround additional

View File

@@ -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;