diff options
author | Gerald Combs <gerald@wireshark.org> | 2009-12-01 21:24:48 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2009-12-01 21:24:48 +0000 |
commit | 9338d16323d99ffb25997e8aaa92db24b4b1143a (patch) | |
tree | ef5a8c0dd80c4cdbf2b889721ec918355d74f298 /gtk/gui_utils.c | |
parent | 060ac76f828355bcf54a925d634b3662efe34089 (diff) |
Use pango_font_description_get_size() to pad out the default column
size. This may require tweaking, e.g. with
pango_font_description_set_absolute_size().
svn path=/trunk/; revision=31145
Diffstat (limited to 'gtk/gui_utils.c')
-rw-r--r-- | gtk/gui_utils.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gtk/gui_utils.c b/gtk/gui_utils.c index 437054b09e..fc7317dd4d 100644 --- a/gtk/gui_utils.c +++ b/gtk/gui_utils.c @@ -43,6 +43,7 @@ #include "gtk/gtkglobals.h" #include "gtk/gui_utils.h" +#include "gtk/font_utils.h" #include "gtk/recent.h" #include "image/wsicon16.xpm" @@ -1174,18 +1175,15 @@ gint get_default_col_size(GtkWidget *view, const gchar *str) { PangoLayout *layout; - gint col_width, char_width; - gint str_len = (gint)strlen(str); + gint col_width; layout = gtk_widget_create_pango_layout(view, str); pango_layout_get_pixel_size(layout, &col_width, /* width */ NULL); /* height */ - /* Calculate the width of one character */ - char_width = col_width/str_len; g_object_unref(G_OBJECT(layout)); /* Add a single characters width to get some spacing between rows */ - return col_width+char_width; + return col_width + (pango_font_description_get_size(user_font_get_regular()) / PANGO_SCALE); } |