mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-15 23:00:08 +00:00
[PATCH 5/7] bgo543308 - Unconditionally compute a size based on font size
Signed-off-by: Federico Mena Quintero <federico@novell.com> svn path=/trunk/; revision=21166
This commit is contained in:
parent
73fa2005fc
commit
8a8915e0fd
@ -7780,28 +7780,21 @@ find_good_size_from_style (GtkWidget *widget,
|
||||
g_assert (widget->style != NULL);
|
||||
impl = GTK_FILE_CHOOSER_DEFAULT (widget);
|
||||
|
||||
if (impl->default_width == 0 &&
|
||||
impl->default_height == 0)
|
||||
screen = gtk_widget_get_screen (widget);
|
||||
if (screen)
|
||||
{
|
||||
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) * resolution / 72.0;
|
||||
|
||||
impl->default_width = font_size * NUM_CHARS;
|
||||
impl->default_height = font_size * NUM_LINES;
|
||||
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 */
|
||||
|
||||
*width = impl->default_width;
|
||||
*height = impl->default_height;
|
||||
font_size = pango_font_description_get_size (widget->style->font_desc);
|
||||
font_size = PANGO_PIXELS (font_size) * resolution / 72.0;
|
||||
|
||||
*width = font_size * NUM_CHARS;
|
||||
*height = font_size * NUM_LINES;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user