PANGO_PIXELS() gives us device units, which are *points* in pangocairo's

2007-03-15  Federico Mena Quintero  <federico@novell.com>

	* gtk/gtkfilechooserdefault.c (find_good_size_from_style):
	PANGO_PIXELS() gives us device units, which are *points* in
	pangocairo's parlance, but we want actual pixels.  So, get the
	screen's resolution to compute the actual number of pixels.
	Fixes bug #418585.

svn path=/branches/gtk-2-10/; revision=17529
This commit is contained in:
Federico Mena Quintero
2007-03-16 00:51:18 +00:00
committed by Federico Mena Quintero
parent c3f89db45d
commit e89926da22
2 changed files with 21 additions and 1 deletions

View File

@@ -1,3 +1,11 @@
2007-03-15 Federico Mena Quintero <federico@novell.com>
* gtk/gtkfilechooserdefault.c (find_good_size_from_style):
PANGO_PIXELS() gives us device units, which are *points* in
pangocairo's parlance, but we want actual pixels. So, get the
screen's resolution to compute the actual number of pixels.
Fixes bug #418585.
2007-03-15 Emmanuele Bassi <ebassi@gnome.org>
Merge from trunk:

View File

@@ -7145,12 +7145,24 @@ find_good_size_from_style (GtkWidget *widget,
gint default_width, default_height;
int font_size;
GtkRequisition req;
GdkScreen *screen;
double resolution;
g_assert (widget->style != NULL);
impl = GTK_FILE_CHOOSER_DEFAULT (widget);
screen = gtk_widget_get_screen (widget);
if (screen)
{
resolution = gdk_screen_get_resolution (screen);
if (resolution < 0.0) /* will be -1 if the resolution is not defined in the GdkScreen */
resolution = 96.0;
}
else
resolution = 96.0; /* wheeee */
font_size = pango_font_description_get_size (widget->style->font_desc);
font_size = PANGO_PIXELS (font_size);
font_size = PANGO_PIXELS (font_size) * resolution / 72.0;
default_width = font_size * NUM_CHARS;
default_height = font_size * NUM_LINES;