aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-settings-dialog.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-09-20 03:56:14 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-09-20 03:56:14 +0800
commitd4f22aebb0cd2fd8d9e2032e5e2bfe49c8328f1a (patch)
treeda049170cb728b64a1fb0b283567132d4e81dddf /shell/e-shell-settings-dialog.c
parent3161974bc1558112f19114f2884a0ace1fb77475 (diff)
downloadgsoc2013-evolution-d4f22aebb0cd2fd8d9e2032e5e2bfe49c8328f1a.tar.gz
gsoc2013-evolution-d4f22aebb0cd2fd8d9e2032e5e2bfe49c8328f1a.tar.zst
gsoc2013-evolution-d4f22aebb0cd2fd8d9e2032e5e2bfe49c8328f1a.zip
[Fix #28495 with a lame hack that works around Bonobo sizing
brokenness] (set_dialog_size): New. (impl_realize): Override for GtkWidget::realize; invoke set_dialog_size() to set a minimum size. (class_init): Install. svn path=/trunk/; revision=18126
Diffstat (limited to 'shell/e-shell-settings-dialog.c')
-rw-r--r--shell/e-shell-settings-dialog.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/shell/e-shell-settings-dialog.c b/shell/e-shell-settings-dialog.c
index dcc57ce621..f0f5101d65 100644
--- a/shell/e-shell-settings-dialog.c
+++ b/shell/e-shell-settings-dialog.c
@@ -50,6 +50,23 @@ struct _EShellSettingsDialogPrivate {
};
+/* FIXME ugly hack to work around that sizing of invisible widgets is broken
+ with Bonobo. */
+
+static void
+set_dialog_size (EShellSettingsDialog *dialog)
+{
+ GdkFont *font;
+ int width, height;
+
+ font = GTK_WIDGET (dialog)->style->font;
+ width = gdk_string_width (font, "M") * 66;
+ height = (font->ascent + font->descent) * 35;
+
+ gtk_widget_set_usize (GTK_WIDGET (dialog), width, height);
+}
+
+
/* Page handling. */
struct _Page {
@@ -236,6 +253,21 @@ load_pages (EShellSettingsDialog *dialog)
}
+/* GtkWidget methods. */
+
+static void
+impl_realize (GtkWidget *widget)
+{
+ EShellSettingsDialog *dialog;
+
+ dialog = E_SHELL_SETTINGS_DIALOG (widget);
+
+ set_dialog_size (dialog);
+
+ (* GTK_WIDGET_CLASS (parent_class)->realize) (widget);
+}
+
+
/* GtkObject methods. */
static gboolean
@@ -268,10 +300,14 @@ static void
class_init (EShellSettingsDialog *class)
{
GtkObjectClass *object_class;
+ GtkWidgetClass *widget_class;
object_class = GTK_OBJECT_CLASS (class);
object_class->destroy = impl_destroy;
+ widget_class = GTK_WIDGET_CLASS (class);
+ widget_class->realize = impl_realize;
+
parent_class = gtk_type_class (PARENT_TYPE);
}
@@ -288,7 +324,6 @@ init (EShellSettingsDialog *dialog)
load_pages (dialog);
gtk_window_set_title (GTK_WINDOW (dialog), _("Evolution Settings"));
- gtk_window_set_default_size (GTK_WINDOW (dialog), 600, 450);
}