/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2001 Match Grun
+ * Copyright (C) 2001-2007 Match Grun and the Claws Mail team
*
* 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
return FALSE;
}
+static void addressadd_size_allocate_cb(GtkWidget *widget,
+ GtkAllocation *allocation)
+{
+ g_return_if_fail(allocation != NULL);
+
+ prefs_common.addressaddwin_width = allocation->width;
+ prefs_common.addressaddwin_height = allocation->height;
+}
+
static void addressadd_create( void ) {
GtkWidget *window;
GtkWidget *vbox;
GtkWidget *hsbox;
GtkWidget *statusbar;
gint top;
+ static GdkGeometry geometry;
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_widget_set_size_request( window, 300, 400 );
gtk_container_set_border_width( GTK_CONTAINER(window), 0 );
gtk_window_set_title( GTK_WINDOW(window), _("Add to address book") );
gtk_window_set_position( GTK_WINDOW(window), GTK_WIN_POS_MOUSE );
G_CALLBACK(addressadd_delete_event), NULL );
g_signal_connect( G_OBJECT(window), "key_press_event",
G_CALLBACK(addressadd_key_pressed), NULL );
+ g_signal_connect(G_OBJECT(window), "size_allocate",
+ G_CALLBACK(addressadd_size_allocate_cb), NULL);
vbox = gtk_vbox_new(FALSE, 8);
gtk_container_add(GTK_CONTAINER(window), vbox);
gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
/* Button panel */
- gtkut_stock_button_set_create(&hbbox, &ok_btn, GTK_STOCK_OK,
- &cancel_btn, GTK_STOCK_CANCEL,
+ gtkut_stock_button_set_create(&hbbox, &cancel_btn, GTK_STOCK_CANCEL,
+ &ok_btn, GTK_STOCK_OK,
NULL, NULL);
gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
gtk_container_set_border_width( GTK_CONTAINER(hbbox), 0 );
g_signal_connect(G_OBJECT(tree_folder), "button_press_event",
G_CALLBACK(addressadd_tree_button), NULL);
+ if (!geometry.min_height) {
+ geometry.min_width = 300;
+ geometry.min_height = 400;
+ }
+
+ gtk_window_set_geometry_hints(GTK_WINDOW(window), NULL, &geometry,
+ GDK_HINT_MIN_SIZE);
+ gtk_widget_set_size_request(window, prefs_common.addressaddwin_width,
+ prefs_common.addressaddwin_height);
+
gtk_widget_show_all(vbox);
addressadd_dlg.window = window;
/* Add node for address book */
abf = ds->rawDataSource;
name = &dsName;
- node = gtk_sctree_insert_node( tree, NULL, NULL,
+ node = gtk_ctree_insert_node( tree, NULL, NULL,
name, FOLDER_SPACING, bookXpm,
bookXpmMask, bookXpm, bookXpmMask,
FALSE, TRUE );