]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkrecentchooserdefault.c
filechooserbutton: Add a description string to assertions about emitted signals
[~andy/gtk] / gtk / gtkrecentchooserdefault.c
index 88b3169ac9577e76b6629784d4a3961c07d3d72f..2d15efee8531729192d0c69815f465a4db15a963 100644 (file)
@@ -13,9 +13,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
@@ -924,7 +922,7 @@ set_default_size (GtkRecentChooserDefault *impl)
   GtkScrolledWindow *scrollw;
   GtkWidget *widget;
   gint width, height;
-  gint font_size;
+  double font_size;
   GdkScreen *screen;
   gint monitor_num;
   GtkRequisition req;
@@ -937,11 +935,10 @@ set_default_size (GtkRecentChooserDefault *impl)
   state = gtk_widget_get_state_flags (widget);
 
   /* Size based on characters and the icon size */
-  font_size = pango_font_description_get_size (gtk_style_context_get_font (context, state));
-  font_size = PANGO_PIXELS (font_size);
+  gtk_style_context_get (context, state, "font-size", &font_size, NULL);
 
-  width = impl->icon_size + font_size * NUM_CHARS;
-  height = (impl->icon_size + font_size) * NUM_LINES;
+  width = impl->icon_size + font_size * NUM_CHARS + 0.5;
+  height = (impl->icon_size + font_size) * NUM_LINES + 0.5;
 
   /* Use at least the requisition size... */
   gtk_widget_get_preferred_size (widget, &req, NULL);