NULL, NULL, NULL},
{"messagewin_height", "540", &prefs_common.msgwin_height, P_INT,
NULL, NULL, NULL},
+ {"sourcewin_width", "600", &prefs_common.sourcewin_width, P_INT,
+ NULL, NULL, NULL},
+ {"sourcewin_height", "500", &prefs_common.sourcewin_height, P_INT,
+ NULL, NULL, NULL},
{"compose_width", "600", &prefs_common.compose_width, P_INT,
NULL, NULL, NULL},
{"compose_height", "560", &prefs_common.compose_height, P_INT,
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2003 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "gtkutils.h"
#include "prefs_common.h"
+static void source_window_size_alloc_cb (GtkWidget *widget,
+ GtkAllocation *allocation);
static void source_window_destroy_cb (GtkWidget *widget,
SourceWindow *sourcewin);
static void key_pressed (GtkWidget *widget,
gtk_window_set_title(GTK_WINDOW(window), _("Source of the message"));
gtk_window_set_wmclass(GTK_WINDOW(window), "source_window", "Sylpheed");
gtk_window_set_policy(GTK_WINDOW(window), TRUE, TRUE, FALSE);
- gtk_widget_set_usize(window, 600, 500);
+ gtk_widget_set_usize(window, prefs_common.sourcewin_width,
+ prefs_common.sourcewin_height);
+ gtk_signal_connect(GTK_OBJECT(window), "size_allocate",
+ GTK_SIGNAL_FUNC(source_window_size_alloc_cb),
+ sourcewin);
gtk_signal_connect(GTK_OBJECT(window), "destroy",
GTK_SIGNAL_FUNC(source_window_destroy_cb),
sourcewin);
void source_window_append(SourceWindow *sourcewin, const gchar *str)
{
+ gchar *out;
+ gint len;
+
+ len = strlen(str) + 1;
+ Xalloca(out, len, return);
+ conv_localetodisp(out, len, str);
gtk_text_insert(GTK_TEXT(sourcewin->text), msgfont, NULL, NULL,
- str, -1);
+ out, -1);
+}
+
+static void source_window_size_alloc_cb(GtkWidget *widget,
+ GtkAllocation *allocation)
+{
+ g_return_if_fail(allocation != NULL);
+
+ prefs_common.sourcewin_width = allocation->width;
+ prefs_common.sourcewin_height = allocation->height;
}
static void source_window_destroy_cb(GtkWidget *widget,