gtk+ r21166 - trunk/gtk
- From: federico svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r21166 - trunk/gtk
- Date: Wed, 20 Aug 2008 01:12:36 +0000 (UTC)
Author: federico
Date: Wed Aug 20 01:12:35 2008
New Revision: 21166
URL: http://svn.gnome.org/viewvc/gtk+?rev=21166&view=rev
Log:
[PATCH 5/7] bgo543308 - Unconditionally compute a size based on font size
Signed-off-by: Federico Mena Quintero <federico novell com>
Modified:
trunk/gtk/gtkfilechooserdefault.c
Modified: trunk/gtk/gtkfilechooserdefault.c
==============================================================================
--- trunk/gtk/gtkfilechooserdefault.c (original)
+++ trunk/gtk/gtkfilechooserdefault.c Wed Aug 20 01:12:35 2008
@@ -7780,28 +7780,21 @@
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 */
+
+ font_size = pango_font_description_get_size (widget->style->font_desc);
+ font_size = PANGO_PIXELS (font_size) * resolution / 72.0;
- *width = impl->default_width;
- *height = impl->default_height;
+ *width = font_size * NUM_CHARS;
+ *height = font_size * NUM_LINES;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]